Quantcast
Channel: Bashタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 2802

【Bash】大量のファイルから100個取り出して別のディレクターに移す方法。

$
0
0

dir_A内にある大量のファイル(拡張子は.txt)から100個取り出して、dir_Bに移す方法。

count=0
while read file
do
  if[$count-ge 100 ];then
    break
  fi
  count=$(($count+1))mv"${file}""./dir_B/"done< <(find ./dir_A -name'*.txt')

参考

https://qiita.com/daei/items/76635f9fbf25824b525e


Viewing all articles
Browse latest Browse all 2802

Trending Articles