简体   繁体   中英

How to move X number of files randomly in Mac terminal?

How can I move 100 random files from one directory to another in the Mac terminal? I would use shuf in linux.

根据 glenn 的推荐,答案如下(这将在当前目录中移动 100 个随机文件):

shuf -zen100 * | xargs -0 -J % mv % /New_Dir/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM