如何在Ubuntu 12.04中删除确认文件

时间:2014-12-02 20:05:59

标签: linux linux-kernel ubuntu-12.04 ubuntu-14.04

我需要知道标志设置用于消除带有确认的文件。

我使用过rm -rf文件夹,但这是错误的,因为删除没有确认的文件

太试试-i,但是按文件删除文件。我需要立即删除所有文件夹,但确认是否是

fernando@fernando:~$ rm -rfi jquery/
rm: ¿descender al directorio «jquery»? (s/n) 

2 个答案:

答案 0 :(得分:2)

rm -rI <folder>会要求确认,因为-I标志会提示用户确认(仅限文件夹本身)。

答案 1 :(得分:1)

rm -r 

将起作用 - 默认情况下要求确认。

-r标志用于递归 -f标志用于'强制'(即不要求确认)

man rm 

会给你很多信息

-f  Attempt to remove the files without prompting for confirmation, 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.