想要全部删除,这就要看你是否有对「5次循环中前4次生成的那些对象」的引用,比如放在了一个数组或者容器中,如果有,就可以遍历数组或者容器来删除,否则你无法删除,因为你都没有对它们的引用。
如果还需帮助,你可以把全部的代码粘贴出来看看~
java -cp tools.jar com.tools.fb.tools.redfine.WatchFileChangedTask一、查询UNIX的大文件
find . -type f -size +100M (path 为自己指定的目录,如当前目录./);
按照文件大小排序
du -a /var -h | sort -n -r | head -n 10
不看错误
grep -vP 'No such file or directory'
二、批量删除文件
pgm `autoget paganihost` -v -A "sudo -u admin -H sh -c 'cat /dev/null >/home/admin/pagani/logs/service_stdout.log'"pgm `autoget paganihost` -v -A "sudo -u admin -H sh -c 'rm -rf /home/admin/pagani/logs/service_stdout.log.*'"
三、批量重启机器
1、sudo -u admin -H sh jbossctl restart
2、start | stop | online |offline |pubstart |restart |deploy
/opt/taobao/install
解压
$sudo tar zxvf jdk.tgz -C ./ajdk-8.x
/bin
export JAVA_HOME = /opt/taobao/install/ajdk-8.x/j2sdk-image
export PATH = $JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
#source /etc/profile
获取机器autoget paganihost >pagani.listsed -n '1,200p' pagani.list >pagani.list.1sed -n '201,400p' pagani.list >pagani.list.2sed -n '401,600p' pagani.list >pagani.list.3sed -n '601,800p' pagani.list >pagani.list.4杀进程pgm -A -b -f pagani.list.0 "ps -ef | grep pagani | grep -v "grep" | awk '{print $2}' |sudo -u admin xargs kill -l"重启pgm -A -b -f pagani.list.0 -A -b "sudo -u admin /home/admin/pagani/bin/jbossctl restart"
tar zxvf
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)