rm指令参数介绍

特别提醒

读者在使用rm以及rm和其他命令的组合时,先确定命令每个部分的含义,避免造成不希望的、不可挽回的结果。


本文为rm参数介绍。翻译自

rm [OPTION]... FILE...

Description

This manual page documents the GNU version of rmrm removes each specified file. By default, it does not remove directories.

本页记录了rm的GNU版本。rm删除每个给定的文件。默认情况下,不会删除目录。

 

If the -I or --interactive=once option is given, and there are more than three files or the -r-R, or --recursive are given, then rm prompts the user for whether to proceed with the entire operation. If the response is not affirmative, the entire command is aborted.

如果给定选项-I(i大写)或--interactive=once,并且有超过3个文件或给定参数-r , -R , --recursive之一,rm会提示用户是否继续操作。如果用户没有选择继续,命令中止。

Otherwise, if a file is unwritable, standard input is a terminal, and the -f or --force option is not given, or the -i or --interactive=always option is given, rm prompts the user for whether to remove the file. If the response is not affirmative, the file is skipped.

另外,如果一个文件不可写,标准输入是终端,并且没有给定-f , --force或给定了-i , --interactive=always,rm会提示用户是否删除文件。如果用户没有给予肯定答复,该文件被跳过。

Options

Remove (unlink) the FILE(s).

删除(未链接)文件。

-f--force

ignore nonexistent files, never prompt

忽略不存在的文件,不会提示。

-i

prompt before every removal

每次删除前进行提示。

-I

prompt once before removing more than three files, or when removing recursively. Less intrusive than -i, while still giving protection against most mistakes.

删除超过3个文件时,或者使用递归删除时,提示一次。没有-i那么繁琐,但还是有对防止误操作的基本保护。

--interactive[=WHEN]

prompt according to WHEN: never, once (-I), or always (-i). Without WHEN, prompt always

不同WHEN下的提示:从不提示,提示一次(-I),总是提示(-i)。不带WHEN时,总是提示。

--one-file-system

when removing a hierarchy recursively, skip any directory that is on a file system different from that of the corresponding command line argument.

递归删除层级时,跳过与参数不同的文件系统。

--no-preserve-root

do not treat '/' specially

不用特别对待 ' / ' (不用保护根目录)。

--preserve-root

do not remove '/' (default)

不要删除 ' / '(保护根目录)。

-r-R--recursive

remove directories and their contents recursively

递归删除目录及其内容。

-v--verbose

explain what is being done

显示rm执行时的详细工作内容。

--help

display this help and exit

显示帮助内容。

--version

output version information and exit

输出版本信息。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值