One Linux command per day-RM

Source: Internet
Author: User

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:

    1. 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-RF





One Linux command per day-RM

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.