What are rm and rf commands?
Posted: Thu Jul 21, 2022 5:30 am
- 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.