用每个文件夹最多100个文件重新排序文件

取一个文件夹并将其分割成包含最大文件数的较小文件夹。在这种情况下,每个directory.find创建100个文件创建filesxargs列表,将每个组的列表分成100个组,创建一个目录并复制到文件中注意:如果文件名中有空白,则此命令将不起作用(但然后再次,也没有替代命令:-)
.

0

linux命令:files -type f | xargs -n100 | while read l; do mkdir $((++f)); cp $l $f; done done $f; $l cp $((++f)); mkdir do l; read while | -n100 xargs | f -type files files -type f | xargs -n100 | while read l; do mkdir $((++f)); cp $l $f; donerootopen.com
linux命令:files -type f | xargs -n100 | while read l; do mkdir $((++f)); cp $l $f; done done $f; $l cp $((++f)); mkdir do l; read while | -n100 xargs | f -type files files -type f | xargs -n100 | while read l; do mkdir $((++f)); cp $l $f; donerootopen.com
zyhj 2018-02-17 21:35:48
输出
替代方案1 用每个文件夹最多100个文件重新排序文件

如果你有一个有数千个文件的文件夹,并且想要每个文件夹只有100个文件的多个文件夹,运行这个。它会创建0 /,1 / etc并在每个文件中放置100个文件。但是即使它发现它也会返回true找不到任何东西....

linux命令:folder=0;mkdir $folder; while find -maxdepth 1 -type f -exec mv "{}" $folder \; -quit ; do if [ $( ls $folder | wc -l ) -ge 100 ]; then folder=$(( $folder + 1 )); mkdir $folder; fi ; done done ; fi $folder; mkdir )); 1 + $folder folder=$(( then ]; 100 -ge ) -l wc | $folder ls $( [ if do ; -quit \; $folder "{}" mv -exec f -type 1 -maxdepth find while $folder; folder=0;mkdir folder=0;mkdir $folder; while find -maxdepth 1 -type f -exec mv "{}" $folder \; -quit ; do if [ $( ls $folder | wc -l ) -ge 100 ]; then folder=$(( $folder + 1 )); mkdir $folder; fi ; donerootopen.com
linux命令:folder=0;mkdir $folder; while find -maxdepth 1 -type f -exec mv "{}" $folder \; -quit ; do if [ $( ls $folder | wc -l ) -ge 100 ]; then folder=$(( $folder + 1 )); mkdir $folder; fi ; done done ; fi $folder; mkdir )); 1 + $folder folder=$(( then ]; 100 -ge ) -l wc | $folder ls $( [ if do ; -quit \; $folder "{}" mv -exec f -type 1 -maxdepth find while $folder; folder=0;mkdir folder=0;mkdir $folder; while find -maxdepth 1 -type f -exec mv "{}" $folder \; -quit ; do if [ $( ls $folder | wc -l ) -ge 100 ]; then folder=$(( $folder + 1 )); mkdir $folder; fi ; donerootopen.com
.
输出
替代方案2 用每个文件夹最多100个文件重新排序文件

更小的CodeBetter运行时.

linux命令:find files/ -type f | while read line; do if [ $((i++%100)) -eq 0 ]; then mkdir $((++folder)); fi; cp $line $folder/; done done $folder/; $line cp fi; $((++folder)); mkdir then ]; 0 -eq $((i++%100)) [ if do line; read while | f -type files/ find find files/ -type f | while read line; do if [ $((i++%100)) -eq 0 ]; then mkdir $((++folder)); fi; cp $line $folder/; donerootopen.com
linux命令:find files/ -type f | while read line; do if [ $((i++%100)) -eq 0 ]; then mkdir $((++folder)); fi; cp $line $folder/; done done $folder/; $line cp fi; $((++folder)); mkdir then ]; 0 -eq $((i++%100)) [ if do line; read while | f -type files/ find find files/ -type f | while read line; do if [ $((i++%100)) -eq 0 ]; then mkdir $((++folder)); fi; cp $line $folder/; donerootopen.com
.
输出

评论

相关推荐

如果你想更新你的motd,可以安装在root crontab中。如果不是在Ubuntu上,你需要将/ usr / share / cowsay / cows / *更改为牛文件的位置。

linux命令:files=(/usr/share/cowsay/cows/*);cowsay -f `printf "%s\n" "${files[RANDOM % ${#files}]}"` "`fortune`" "`fortune`" ${#files}]}"` % "${files[RANDOM "%s\n" `printf -f files=(/usr/share/cowsay/cows/*);cowsay files=(/usr/share/cowsay/cows/*);cowsay -f `printf "%s\n" "${files[RANDOM % ${#files}]}"` "`fortune`"rootopen.com
linux命令:files=(/usr/share/cowsay/cows/*);cowsay -f `printf "%s\n" "${files[RANDOM % ${#files}]}"` "`fortune`" "`fortune`" ${#files}]}"` % "${files[RANDOM "%s\n" `printf -f files=(/usr/share/cowsay/cows/*);cowsay files=(/usr/share/cowsay/cows/*);cowsay -f `printf "%s\n" "${files[RANDOM % ${#files}]}"` "`fortune`"rootopen.com
.

linux命令:files=$(find /dir/file -name *.txt -exec grep -l a {} \;) && perl -p -i -e 's/old/new/g;' $files $files 's/old/new/g;' -e -i -p perl && \;) {} a -l grep -exec *.txt -name /dir/file files=$(find files=$(find /dir/file -name *.txt -exec grep -l a {} \;) && perl -p -i -e 's/old/new/g;' $filesrootopen.com
linux命令:files=$(find /dir/file -name *.txt -exec grep -l a {} \;) && perl -p -i -e 's/old/new/g;' $files $files 's/old/new/g;' -e -i -p perl && \;) {} a -l grep -exec *.txt -name /dir/file files=$(find files=$(find /dir/file -name *.txt -exec grep -l a {} \;) && perl -p -i -e 's/old/new/g;' $filesrootopen.com
.
共收录0条命令行
这里是记录和分享命令行的地方, 所有命令行都可以进行评论、提交替代方案.

推荐
    热门命令