Tuesday, August 24, 2010

Deleting folders/sub folders/files in linux

rm myfile.txt

Remove the file myfile.txt without prompting the user.

rm -r directory

Remove a directory, even if files existed in that directory. 

Note: if you use rm to remove a file, it is usually possible to recover the contents of that file. If you want more assurance that the contents are truly unrecoverable, consider using shred.

rmdir mydir - removes the directory mydir

shred myfile.txt

Permanently deleted and makes the file myfile.txt unrecoverable (unless stored elsewhere or on a backup).

No comments:

Post a Comment