作成
【linux】ファイル数が多すぎてコピー失敗, 大量ファイルをコピーしたい unable to execute /usr/bin/cp: Argument list too long
/hoge/ にある大量のファイルを /hoge2/ に移動させようとすると以下のエラー。 ###command sudo cp -R /hoge/* /hoge2/ ### エラー ###error command sudo: unable to execute /usr/bin/cp: Argument list too long ### この解決方法としてfind を使います。 ###command solve ( cp -R /hoge/* /hoge2/ と同じ) find /hoge/ -name "*" -print0 | xargs -0 -I {} cp -R {} /hoge2/ ###disable ついでに ファイル数をカウントする場合は ファイル数をカウントする場合は (/hoge2/ はディレクトリ) ls -l /hoge2/ | wc -l find /hoge2/ -type f | wc -l ディレクトリの使用量 (/hoge2/ はディレクトリ) du -sh /hoge2/
wakatta 記法
投稿の仕方
基本的な記法
エンジニア向け記法
記法のサンプル
このコンテンツを見る