Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 如何在Mac终端中随机移动X个文件?_Macos_Command Line_Terminal - Fatal编程技术网

Macos 如何在Mac终端中随机移动X个文件?

Macos 如何在Mac终端中随机移动X个文件?,macos,command-line,terminal,Macos,Command Line,Terminal,如何在Mac终端中将100个随机文件从一个目录移动到另一个目录?我会在linux中使用shuf。根据glenn的建议,以下是答案,这将在当前目录中移动100个随机文件: shuf -zen100 * | xargs -0 -J % mv % /New_Dir/ 看见

如何在Mac终端中将100个随机文件从一个目录移动到另一个目录?我会在linux中使用shuf。

根据glenn的建议,以下是答案,这将在当前目录中移动100个随机文件:

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