LoginSignup
0
0

More than 1 year has passed since last update.

いちばん最近編集した(最終更新日が一番新しい)ファイルを開くコマンド

Last updated at Posted at 2022-09-23

これでカレントフォルダの全ファイルを最終更新日順に表示できる

find . -type f -printf '%T@ %p\n' | sort -nr | cut -d " " -f 2

最新ファイルだけ取得する関数にして...

# 第一引数: 検索するフォルダ (省略時はカレントフォルダ)
# 第二引数: 行数 (省略時は1)
function latest(){
  find ${1:-.} -type f -printf '%T@ %p\n' | sort -nr | cut -d " " -f 2 | head -${2:-1}
}

VSCodeで開ける

code `latest src`
0
0
0

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
0
0