GNU/Linux >> Linux の 問題 >  >> Linux

最新のファイルを見つけますか?

特定のディレクトリで最近アクセスしたファイルを見つけるにはどうすればよいですか?

findを使用できます 最後のnで変更/アクセスされたすべてのファイルを一覧表示するコマンド 分。しかし、ここで私の場合、最後のファイルがいつ変更/アクセスされたかわかりませんか?必要なのは、他のすべてのサブファイルまたはサブディレクトリの中でごく最近アクセス/変更されたすべてのファイルを、たとえばアクセス/変更された時間でソートして一覧表示することです。

それは可能ですか?

承認された回答:

再帰スイッチを使用できます(-R )からls 時間による並べ替えスイッチ(-t )およびリバースソートスイッチ(-r )ディレクトリツリー内のすべてのファイルを一覧表示します。これにより、サブディレクトリ全体のアクセス/変更日ですべてのファイルが並べ替えられるわけではありませんが、各サブディレクトリ内のこの日付で個別に並べ替えられます。

次のようなコマンドを使用します:ls -ltrR <sometopdir>

$ ls -ltrR .
total 759720
[email protected]  1 sammingolelli  staff    2514441 Mar 31  2015 restfulapi-120704053212-phpapp01.pdf
[email protected]  1 sammingolelli  staff     567808 Apr  7  2015 USGCB-Windows-Settings.xls
[email protected]  1 sammingolelli  staff     180736 Apr  7  2015 USGCB-RHEL5-Desktop-Settings-Version-1.2.5.0.xls
[email protected]  1 sammingolelli  staff       6474 Apr  8  2015 tap_kp_mavericks.txt

./kerberos:
total 5464
[email protected] 1 sammingolelli  staff    37317 Oct  2 13:03 Set_up_Kerberos_instruction_d8.docx
[email protected] 1 sammingolelli  staff  2753195 Oct 13 13:49 Keberos configuration with AD 01_09_2014.pdf

./homestarrunner:
total 10624
[email protected] 1 sammingolelli  staff   319422 May 10  2000 error_hs.wav
[email protected] 1 sammingolelli  staff    53499 Jun  8  2001 sb_duck.mp3
[email protected] 1 sammingolelli  staff   199254 Mar 11  2002 email_sb.wav
[email protected] 1 sammingolelli  staff    39288 Mar 25  2002 bubs_dontutalk.mp3
[email protected] 1 sammingolelli  staff    75432 May  6  2002 trash_sb.wav
[email protected] 1 sammingolelli  staff   298946 Dec  1  2002 error_sb.wav
[email protected] 1 sammingolelli  staff   298686 Dec  1  2002 startup_hs.wav
[email protected] 1 sammingolelli  staff    90279 Dec  1  2002 sb_meedlymee.mp3
[email protected] 1 sammingolelli  staff    73561 Dec  1  2002 sb_dubdeuce.mp3
[email protected] 1 sammingolelli  staff   193097 Dec  1  2002 sb_pizza.mp3
[email protected] 1 sammingolelli  staff    30093 Dec  1  2002 sb_stiny.mp3
[email protected] 1 sammingolelli  staff    61858 Dec  1  2002 ss_sadflying.mp3
[email protected] 1 sammingolelli  staff   150142 Dec  1  2002 email_hs.wav
[email protected] 1 sammingolelli  staff    68545 Dec  1  2002 bubs_grabbinbutt.mp3
[email protected] 1 sammingolelli  staff    61022 Dec  1  2002 cz_jeorghb.mp3
[email protected] 1 sammingolelli  staff    40124 Dec  1  2002 marzy_nasty.mp3
[email protected] 1 sammingolelli  staff   224116 Dec  1  2002 shutdown_sb.wav
[email protected] 1 sammingolelli  staff   260546 Dec  1  2002 shutdown_hs.wav
[email protected] 1 sammingolelli  staff    57686 Dec  1  2002 trash_hs.wav

Linux
  1. Gnu Parted Resizepart In Script?

  2. 最大のファイルを再帰的に検索しますか?

  3. 検索を使用して複数のファイルの名前を変更するにはどうすればよいですか?

  1. Linuxで重複ファイルを見つける方法

  2. 重複ファイルを見つけますか?

  3. ファイルを検索してコピーする

  1. 最大のファイルまたはディレクトリを見つけますか?

  2. 別のディレクトリにある最初のNファイルをコピーしますか?

  3. Linuxの検索コマンド