I am fairly new to linux and I found this command 'rm -rf' which is confusing. I wanted to know whats the difference between 'rm' and 'rm -rf' and when should those be used?
rm is the same as "del". It deletes the specified file. It will not delete directories. It will also warn you about deleting some files.
rm -rf adds the "recursive" and "force" flags. It will remove the specified file and silently ignore any warnings when doing so. If it is a directory, it will remove the directory and all its contents, including subdirectories.
Check out the man page. rm
removes files and -rf are to options: -r
remove directories and their contents recursively, -f
ignore nonexistent files, never prompt.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With