LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old Today, 02:57 AM   #1
exerceo
Member
 
Registered: Oct 2022
Posts: 114

Rep: Reputation: 20
Lightbulb Why can non-empty directories not be deleted directly? [self-answered]


[Log in to get rid of this advertisement]
[This is a self-answered question. Just added for completeness.]

Deletion works by unlinking a file from the file system tree and marking the space it occupied as unused. If a directory was unlinked from the file system without deleting its contents first, the space occupied by those files would not be made free, so it would waste space.

This is why a non-empty directory can't just be deleted in a single operation.
 
Old Today, 03:24 AM   #2
why_bother
Member
 
Registered: Apr 2025
Posts: 44

Rep: Reputation: 11
Quote:
Originally Posted by exerceo View Post
[This is a self-answered question. Just added for completeness.]

Deletion works by unlinking a file from the file system tree and marking the space it occupied as unused. If a directory was unlinked from the file system without deleting its contents first, the space occupied by those files would not be made free, so it would waste space.

This is why a non-empty directory can't just be deleted in a single operation.
While as far as I know you're correct; I don't think this is the right place to be posting questions that you've already answered. I think this should be posted maybe in your blog or maybe the "Linux Tutorials" forum instead of here.
 
Old Today, 04:10 AM   #3
exerceo
Member
 
Registered: Oct 2022
Posts: 114

Original Poster
Rep: Reputation: 20
Blogs don't appear in search engines.

Quote:
Originally Posted by why_bother View Post
While as far as I know you're correct; I don't think this is the right place to be posting questions that you've already answered. I think this should be posted maybe in your blog or maybe the "Linux Tutorials" forum instead of here.
Blogs are not indexed by search engines because they can only be seen while logged in. And it is not exactly a tutorial either. It is a technical explanation for a behaviour.
 
  


Reply

Tags
deletion



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] F27 - Empty Trash Bin icon is showing the non-empty icon Connor84 Fedora 2 02-17-2018 01:18 AM
[SOLVED] Non answered Questions ?? clifftec LQ Suggestions & Feedback 11 08-03-2017 02:05 AM
[SOLVED] [BASH] non-empty variable before loop end, is empty after exiting loop aitor Programming 2 08-26-2010 09:57 AM
can not delete NON-EMPTY directories through samba share Sandor Linux - Software 2 02-16-2006 03:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration