灭霸脚本

Thanos.sh

This command could delete list half your files randomly.

don’t use it at home and other places. this is a real gun, use it wisely…

feel free to post your story on

waiting.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

# 灭霸脚本
这个命令会随机“删掉”您一半的文件。。

请不要在家里或其他地方使用。这是真家伙,要小心…

你可以在```Story.md```文件里发布你的故事,期待中…

## 特别说明
> 1. 支持mac系统,但是需要使用到```gshuf```命令,需要通过```brew```安装,安装命令如下:
```shell
#安装brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
#安装gshuf
brew install coreutils
`

  1. 此脚本只会列出当前目录一半的文件。并且。。。总之小心点。。。

Invoke-Thanos.ps1

Invokes Thanos to remove each object with probability 1/2. It works with files, registry, environment variables, functions, variables, aliases and certificates.

For help, use Get-Help .\Invoke-Thanos.ps1. Be sure to not actually invoke it!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/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 -- cat;
else
find . -not -name "Thanos.sh" -type f -print0 | shuf -z -n $i | xargs -0 -- cat;
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 'cat' into 'rm'.

本人在线上服务器上运行了一次,…

image.png

image.png

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×