How to remove the entire directory in linux comand
The tutorial explains on how to remove empty directories and all subdirectories in Linux operating system.
Linux command:
rm
Remove files (delete/unlink)
SYNTAX
rm [options]… file…
OPTIONS
-d, –directory unlink directory, even if non-empty (super-user only)
-f, –force ignore nonexistent files, never prompt
-i, –interactive prompt before any removal
-r, -R, –recursive remove the contents of directories recursively
-v, –verbose explain what is being done
–help display this help and exit
–version output version information and exit
To remove a file you must have write permission on the file and the folder where it is stored.
rm -rf will recursively remove folders and their contents
The OWNER of a file does not need rw permissions in order to rm it.
Example:
To remove empty directory:
rm foldername
To remove the directory , all its subdirectory and their content :
rm -rf foldername

Ratings:
Posted in:
Uncategorized — admin|
|
|




















tnx……
Comment by nazali — June 17, 2009 @ 5:49 am