rm The parameter list is too long argument list too long
建议空间占用:
cd /u01
du -sh *|grep G | sort -nr | head
进入最大占用的目录,同理检查
参考处理:
[root@hpl ~]# pwd
/root
[root@hpl ~]# cd jyc
[root@hpl jyc]# ll
total 0
[root@hpl jyc]# mkdir 1
[root@hpl jyc]# mkdir 2
[root@hpl jyc]# mkdir 3
[root@hpl jyc]# touch 1.trc 2.trm 3.trc 4.trm
[root@hpl jyc]# ll
total 0
drwxr-xr-x 2 root root 6 Jun 28 10:39 1
-rw-r--r-- 1 root root 0 Jun 28 10:39 1.trc
drwxr-xr-x 2 root root 6 Jun 28 10:39 2
-rw-r--r-- 1 root root 0 Jun 28 10:39 2.trm
drwxr-xr-x 2 root root 6 Jun 28 10:39 3
-rw-r--r-- 1 root root 0 Jun 28 10:39 3.trc
-rw-r--r-- 1 root root 0 Jun 28 10:39 4.trm
[root@hpl jyc]#
先用这个命令操作更保险些。
find ./ -name "*tr*" -type f -exec rm {} \;
[root@hpl jyc]# ll
total 0
drwxr-xr-x 2 root root 6 Jun 28 10:39 1
drwxr-xr-x 2 root root 6 Jun 28 10:39 2
drwxr-xr-x 2 root root 6 Jun 28 10:39 3
[root@hpl jyc]#
删除1天前的目录和文件,务必注意空格之类,千万别搞错。
find ./ -mtime +1 -name "*" -exec rm -rf {} \;
[root@hpl jyc]# ll
total 0
drwxr-xr-x 2 root root 6 Jun 28 10:39 1
drwxr-xr-x 2 root root 6 Jun 28 10:39 2
drwxr-xr-x 2 root root 6 Jun 28 10:39 3
[root@hpl jyc]# find ./ -mtime -1 -name "*" -exec rm -rf {} \;
rm: refusing to remove ‘.’ or ‘..’ directory: skipping ‘./’
find: ‘./1’: No such file or directory
find: ‘./2’: No such file or directory
find: ‘./3’: No such file or directory
[root@hpl jyc]#
[root@hpl jyc]# ll
total 0
[root@hpl jyc]# pwd
/root/jyc
[root@hpl jyc]#