rm-
Here rm stands for remove. And this command is use to remove or delete files and directories in Linux operating system. As we learn 'rmdir' will not delete empty directory but here 'rm' can remove the directories which are not empty as well. So, be careful if you are using rm command.
E.g. - rm file.txt
This will remove file with name file.txt
E.g. - rm file1.txt file2.txt
This will remove above 2 files at same time
Options-
-i:
This option will ask you before removing each file. If you really want to remove the file you have to press y to confirm, and n or any other key to remain as it is.
-f, --force:
This option will forcefully remove the file. And prompts confirmation before removing write protected files. And directly removes files with some minor protection.
Note: This option will not work if the file is write-protected
-r, --recursive:
This option is used when you want to remove any directory as well as it`s subdirectories recursively with respect to the parent directory. Firstly it will delete the child director and then it will remove it`s parent directory.
--version:
When you will run this option with rm command you will know current version of rm command running on your system.
Here rm stands for remove. And this command is use to remove or delete files and directories in Linux operating system. As we learn 'rmdir' will not delete empty directory but here 'rm' can remove the directories which are not empty as well. So, be careful if you are using rm command.
E.g. - rm file.txt
This will remove file with name file.txt
E.g. - rm file1.txt file2.txt
This will remove above 2 files at same time
Options-
-i:
This option will ask you before removing each file. If you really want to remove the file you have to press y to confirm, and n or any other key to remain as it is.
-f, --force:
This option will forcefully remove the file. And prompts confirmation before removing write protected files. And directly removes files with some minor protection.
Note: This option will not work if the file is write-protected
-r, --recursive:
This option is used when you want to remove any directory as well as it`s subdirectories recursively with respect to the parent directory. Firstly it will delete the child director and then it will remove it`s parent directory.
--version:
When you will run this option with rm command you will know current version of rm command running on your system.
No comments:
Post a Comment