LoginSignup
1
2

More than 5 years have passed since last update.

指定したパス配下にある全てのファイル一覧のファイル名称とサイズを取得するコマンド

Posted at
ll -RF [パス] | grep -v / | awk '{printf("%s %s\n", $9, $5); }'

-R: 再帰的に調査
-F: ファイル名にファイル・タイプを表す記号を付けて表示する(詳細は下記の表)。

ファイルの種類 表記
ディレクトリ /
実行可能ファイル *
シンボリックリンク @
FIFO \
ソケット =

-h オプションを ll につけると適切なバイト単位で表示してくれます。)

サンプル出力

01.txt 1254
02.txt 22537
03.txt 501037
04.txt 562537
1
2
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2