Thursday, June 28, 2012

REMOVE FILE OR DIRECTORY FROM CONSOLE LINUX


Use the rmdir command. This command remove the DIRECTORY(ies), if they are empty. Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following command to remove a directory called /tmp/docs:
 
rmdir /tmp/docs
 
If a directory is not empty you will get an error:
$ rmdir letters
Output:
rmdir: letters: Directory not empty
You can cd to the directory to find out files:
$ cd letters
$ ls

Linux Remove Entire Directory Command

To remove all directories and subdirectories use rm command. For example remove letters and all subdirectories and files inside this directory, type the following command (warning all files including subdirectories will be deleted permanently):
$ rm -rf letters/

1 comment:

  1. Online Casino - Karang Pintar
    Play your favorite casino games online. Join Karang Pintar today to 바카라 win free spins หาเงินออนไลน์ and bonus cash! Get 온카지노 100% bonus up to K2$ + 250 free spins

    ReplyDelete