Linux Learning Note--rm command (delete files or directories)

Source: Internet
Author: User

RM: English name remove, delete the meaning.

1. Command format:

rm[选项] 文件或目录

2. Common options:

"rm -f" 强行删除,忽略不存在的文件,不提示确认。(f为force的意思)"rm -i" 进行交互式删除,即删除时会提示确认。(i为interactive的意思)"rm -r" 将参数中列出的全部目录和子目录进行递归删除。(r为recursive的意思)"rm -v" 详细显示删除操作进行的步骤。(v为verbose的意思)

3. Common examples:

1) 删除一个文件

2) 删除一个目录

3) 强制删除一个目录,无需提示确认

4) 删除所有.log文件,显示删除步骤

4. Notes:

1) Linux系统下一旦删除了文件或目录那么它将会消失,而windows系统下我们还可以通过回收站来进行还原;2"rm -rf /" 此命令如果在root用户下执行,则会删除整个操作系统,所以一定要小心。

Linux Learning Note--rm command (delete files or directories)

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.