What are rm and rf commands?

Linux discussions
Post Reply
User avatar
l6vibq
Site Admin
Posts: 45
Joined: Sun Aug 01, 2021 2:42 am
Contact:

What are rm and rf commands?

Post by l6vibq »

  • In Linux, the user can delete/remove directories using rmdir or rm, use of rm which is used to remove non-empty directories, unlike rmdir which is used to remove empty directories.
  • This command is used to remove non-empty directories and all the files in the directory without being prompted if a directory or a file in the current working directory is write-protected (this case is very common when working on forked repository from GitHub) and the user is prompted to provide Y (for yes) to confirm the deletion of the write-protected file. Now using -rf with rm is effective as it can skip part of the user being prompted every time.
You never have to much fuel unless you are on fire!