• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 460
  • Last Modified:

looking for command to remove directory and all below it:

looking a man for rm and rmdir and everytime I try to delete the directory with all below it it wont let me...? any way to do this.?
error message is Diretory not empty
i have also tried it with other shells ;..ie bash
1 Solution
Maciej SsysadminCommented:
rm -rf directory
Be careful, as with this command you won't be asked for anything - it will silently delete your directory and its content.
Maciej SsysadminCommented:
You may check what files are in this directory with "ls -a directory" command. Probably there are some 'hidden' files (hidden = with names starting with '.').
I'm surprised you managed to miss the following from the rm man page

     -R    Attempt to remove the file hierarchy rooted in each file argument.
           The -R option implies the -d option.  If the -i option is speci-
           fied, the user is prompted for confirmation before each directory's
           contents are processed (as well as before the attempt is made to
           remove the directory).  If the user does not respond affirmatively,
           the file hierarchy rooted in that directory is skipped.

     -r    Equivalent to -R.

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

first, is this a mount directory? is it a separate file system? you may run command below to see file systems and their mount directories.

what command you ran to delete dir? did you try

rm -rf dir

Are you root or owner of this  dir?
solunatecAuthor Commented:
sorry tintin I did not see your entry either before i gave the points out: i owe you 250
That's fine I don't need the points.  Did you find the man page description confusing?
Maciej SsysadminCommented:
solunatec: you can always click 'Request Attention' and ask moderators for changing your answer choice. I'm not going to object :)

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now