再帰マニフェストディレクトリを作成する方法

再帰マニフェストディレクトリを作成する方法

何千ものファイルのリストとそのディレクトリパスを繰り返し作成する必要があります。

以下は、マニフェストの出力が必要な方法の例です。

This_is_an_example/of_how/i_want_to_display/absolute_paths/
examplefiles.md5
examplefiles.txt
examplefile.wav

This_is_an_example/of_how/i_want_to_display/absolute_paths/part_2/
examplefiles.md5
examplefiles.txt
examplefile.wav

このコマンドを使用するtree -fai > manifest.txtと必要なものに近づきますが、絶対パスの後に改行文字は生成されません。

次に、サブディレクトリの順次ファイルを1行の入力として出力したいと思います。

This_is_an_example/of_how/i_want_to_display/absolute_paths/part_3/
test_file_here_0000001.dpx
test_file_here_0000002.dpx
test_file_here_0000003.dpx
test_file_here_0000004.dpx

次のように表示されます

 This_is_an_example/of_how/i_want_to_display/absolute_paths/part_4/
 test_file_here_[0000000-0000004].dpx

ベストアンサー1

からman

  -R, --recursive
          list subdirectories recursively

努力する、

ls -R /path/to/dir

もう少し近く、

ll -R /path/to/dir | awk '$1!="total"{print $NF}'

おすすめ記事