在Linux中删除和强制删除之间的区别

时间:2018-09-16 10:04:35

标签: linux ubuntu terminal command

我真的很困惑DELETE和FORCE DELETE有什么区别。 rm -r dirrm -f file有何不同。 谢谢。

1 个答案:

答案 0 :(得分:0)

如果您查看rm的手册页,将会看到它的确切作用:

-f           Attempt to remove the files without prompting for confirma-
             tion, regardless of the file's permissions.  If the file does
             not exist, do not display a diagnostic message or modify the
             exit status to reflect an error.  The -f option overrides any
             previous -i options.

-R           Attempt to remove the file hierarchy rooted in each file
             argument.  The -R option implies the -d option.  If the -i
             option is specified, the user is prompted for confirmation
             before each directory's contents are processed (as well as
             before the attempt is made to remove the directory).  If the
             user does not respond affirmatively, the file hierarchy
             rooted in that directory is skipped.

-r           Equivalent to -R.