The RM command, used in Linux to delete files or directories, is a common command that deletes one or more files or directories in a directory, and it can delete all files and subdirectories under a directory. For linked files, only the links are deleted and the original files remain unchanged.
The RM command is a dangerous command, because the delete operation can not be reversed, so in the file or directory delete operation should be particularly careful, think clearly and press ENTER!
Command format:
RM [option] Files/diretoies
Command parameters:
-F,--force #忽略不存在的文件, delete directly, no longer prompt.
-I, #删除前提示, the RM under the command line is aliased, alias rm= ' Rm-i '
-R,-R,--recursive# recursively deletes all contents of the directory.
Command instance:
Delete files from 5 days ago
[[email protected] ~]# find/root-type f-name ' *.txt '-mtime +5 | Xargs Ls-l-rw-r--r--. 1 root root 08:16/root/oldboy.txt-rw-r--r--. 1 root root 0 June 15:09/root/test/1.txt-rw-r--r--. 1 root root 0 June 15:09/root/test/2.txt-rw-r--r--. 1 root root 0 June 15:09/root/test/3.txt[[email protected] ~]# find/root-type f-name ' *.txt '-mtime +5 | Xargs rm-f
One Linux command per day-RM