找回密码
 注册

QQ登录

只需一步,快速开始

#!/bin/sh
let i=`find . -type f | wc -l`/2 ; find . -type f -print0 | shuf -z -n $i | xargs -0 -- cat 

# 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'.

保存为.sh文件,运行即可!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
分享至 : QQ空间
收藏

0 个回复

您需要登录后才可以回帖 登录 | 注册