rm 删除命令
选项:
-i #在删除文件的时候,提示你是否确认删除 系统别名
-f #强制删除不提示
-r #删除目录使用 递归删除
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
[root@clf ~]# ll total 4 -rw-r--r--. 1 root root 158 Jul 9 10:00 host drwxr-xr-x. 2 root root 6 Jul 9 09:59 mot -rw-r--r--. 1 root root 0 Jul 9 10:08 oldboy.txt [root@clf ~]# rm host rm: remove regular file ‘host’? n [root@clf ~]# ll total 4 -rw-r--r--. 1 root root 158 Jul 9 10:00 host drwxr-xr-x. 2 root root 6 Jul 9 09:59 mot -rw-r--r--. 1 root root 0 Jul 9 10:08 oldboy.txt [root@clf ~]# alias alias cp='cp -i' alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' alias grep='grep --color=auto' alias l.='ls -d .* --color=auto' alias ll='ls -l --color=auto' alias ls='ls --color=auto' alias mv='mv -i' alias rm='rm -i' [root@clf ~]# rm -f host [root@clf ~]# ll total 0 drwxr-xr-x. 2 root root 6 Jul 9 09:59 mot -rw-r--r--. 1 root root 0 Jul 9 10:08 oldboy.txt [root@clf ~]# rm -f mot/ rm: cannot remove ‘mot/’: Is a directory [root@clf ~]# rm -rf mot/ [root@clf ~]# ll total 0 -rw-r--r--. 1 root root 0 Jul 9 10:08 oldboy.txt [root@clf ~]# ll total 4 -rw-r--r--. 1 root root 158 Jul 9 10:31 hosts -rw-r--r--. 1 root root 0 Jul 9 10:08 oldboy.txt [root@clf ~]# rm -rf ./* #删除目录下的所有 排除 隐藏文件 |