Sunday, December 27, 2015

How to Delete Files/Directories?

Deleting files :-

syntax :- rm <filename>

using #rm <filename> , It will ask you confirm to delete file.
you can use #rm -rf <filename>,   It will delete without promting anything .

r- recursively  , f- forcefully

using * you can delete all related to that file name. You can see from below  example for above commands.

Deleting Directory :-

syntax :- rmdir <directoryname>    or  rm -rf  <directoryname>

Using above 2 commands you can delete directories without any prompt .

using # rm -rf *   , we can delete all the files and directories in that folder .  You can see same in below examples.

No comments:

Post a Comment