9 examples for rm
# used to remove (delete) files or directories # delete the file or directory "foo" rm foo # recursively delete all subdirectories and files in directory "foo" rm -rf foo/
Remove specified file ex: rm somefile To remove directory and it's contents, use the -r (recursive) flag ex: rm -r someDirectory Other quick tip, adding f to -r (-rf) will prevent prompting for deletion
# recursively remove all folders and subfolders named 'foo' rm -rf `find -type d -name foo`
# recursively delete all files matching a specified pattern in directory "foo" rm -r foo/ *.txt
# add these lines to your ~/.bash_aliases so you don't screw yourself: alias del='gvfs-trash' alias rm='rm -i' alias mv='mv -i'