私のパスとそのサブディレクトリに特定のサフィックスがあるファイルのリスト(最後の更新日と一緒にリスト)

私のパスとそのサブディレクトリに特定のサフィックスがあるファイルのリスト(最後の更新日と一緒にリスト)

Unixサーバー(Sun Solaris)は、ls -lrtR最後の更新日とともに、パスとそのサブディレクトリにあるすべてのファイルのリストを取得します。

find . -type f -name "*.sas"パスとそのサブディレクトリで.sasファイルのリストが見つかりましたが、属性はありません。

私の.sasファイルと最後の更新日を私のパスとそのサブディレクトリに含めることはできますか?

find / -iname "*.sas"から試してみるすべてのディレクトリでファイルを見つける方法しかし、それは私に次のものを与えます:

find: bad option -iname
find: [-H | -L] path-list predicate-list

find . -type f -name '*.sas'|xargs stat -f '%c %N'|sortから試してみるhttps://unix.stackexchange.com/a/320547/184179しかし、それは私に次のものを与えます:

xargs: Could not exec command: No such file or directory

ベストアンサー1

マニュアルページによると、man findこの-lsオプションを使用して修正時間を表示できます。

 -ls                 Always  true.  Prints  current  pathname
                     together with its associated statistics.
                     These include (respectively):

                         o    inode number

                         o    size in kilobytes (1024 bytes)

                         o    protection mode

                         o    number of hard links

                         o    user

                         o    group

                         o    size in bytes

                         o    modification time.

したがって、あなたの場合、コマンドはfind / -type f -name "*.sas" -ls次のように出力する必要があります。

24584    1 -rw-r--r--   1 user staff           0 Oct  1 13:58 ./a.sas
24586    1 -rw-r--r--   1 user staff           0 Oct  1 13:58 ./b.sas
24587    1 -rw-r--r--   1 user staff           0 Oct  1 13:58 ./c.sas

おすすめ記事