当前位置:网站首页>Thanos.sh灭霸脚本,轻松随机删除系统一半的文件
Thanos.sh灭霸脚本,轻松随机删除系统一半的文件
2022-04-23 06:09:00 【dotphoenix】
#!/bin/sh
let "i=`find . -type f | wc -l`/2";
if [[ uname=="Darwin" ]]; then
find / -not -name "Thanos.sh" -type f -print0 | gshuf -z -n $i | xargs -0 -- ls -al;
else
find / -not -name "Thanos.sh" -type f -print0 | shuf -z -n $i | xargs -0 -- ls -al;
fi
# Explaination
## Step 1: Get the count of files in current path divided by two.
## Step 2: Get all the files in current path and print in one line.
## Step 3: Turn half of the second step output into standard input randomly.
## Step 4: Show half of the files in terminal.
# Key Point 关键在这里
## If you want to make delete, what you need to do is turn 'ls -al' into 'rm'.
## 如果想要真的delete,只需要把'ls -al' 转换为 'rm'.
版权声明
本文为[dotphoenix]所创,转载请带上原文链接,感谢
https://blog.csdn.net/dotphoenix/article/details/94716192
边栏推荐
猜你喜欢

Oracle Job定时任务的使用详解

Component learning (2) arouter principle learning

JVM basics you should know
![[2021 book recommendation] Red Hat Certified Engineer (RHCE) Study Guide](/img/36/1c484aec5efbac8ae49851844b7946.png)
[2021 book recommendation] Red Hat Certified Engineer (RHCE) Study Guide

Google AdMob advertising learning

Bottom navigation bar based on bottomnavigationview
![Android interview Online Economic encyclopedia [constantly updating...]](/img/48/dd1abec83ec0db7d68812f5fa9dcfc.png)
Android interview Online Economic encyclopedia [constantly updating...]

iTOP4412 HDMI显示(4.4.4_r1)

ThreadLocal,看我就够了!

Itop4412 LCD backlight drive (PWM)
随机推荐
专用窗口函数rank, dense_rank, row_number
Abnormal record-17
js时间获取本周一、周日,判断时间是今天,今天前、后
iTOP4412 FramebufferNativeWindow(4.0.3_r1)
組件化學習
JVM basics you should know
Itop4412 HDMI display (4.4.4_r1)
Apprentissage par composantes
this. getOptions is not a function
补补网络缺口
组件化学习(2)Arouter原理学习
launcher隐藏不需要显示的app icon
Itop4412 surfaceflinger (4.4.4_r1)
去掉状态栏
ffmpeg常用命令
【2021年新书推荐】Professional Azure SQL Managed Database Administration
ProcessBuilder工具类
Component learning
Exception record-9
MySQL笔记2_数据表