rm指令参数介绍
特別提醒
讀者在使用rm以及rm和其他命令的組合時,先確定命令每個部分的含義,避免造成不希望的、不可挽回的結果。
本文為rm參數介紹。翻譯自
rm?[OPTION]...?FILE...
Description
This manual page documents the GNU version of?rm.?rm?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
輸出版本信息。
總結
- 上一篇: JavaScript最简单的方法实现简易
- 下一篇: Pr 入门教程:如何使用色轮?