LoginSignup
10
9

More than 5 years have passed since last update.

node_modules 以下のコードを直接修正した後に、修正したファイルの一覧を表示する方法

Posted at

あるあるです。よく忘れるのでメモです。

デバッグのために node_modules 以下のコードを直接修正していたが、途中で寝てしまい、どのコードを修正したのか良く覚えていない。困った…

といったタイミングで修正されているファイルをリストアップする方法です。

ls -tl `find . -regex ".*node_modules.*" -name "*.js" -type f -print` | head -20

カレントディレクトリ以下から node_modules と *.js にマッチするファイルの先頭20行を表示します。
結果は更新日時でソートされています

-rw-rw-rw-  1 foo  Users   22562  7 11 14:40 ./node_modules/bar.js/lib/Bar.js
-rw-rw-rw-  1 foo  Users   13430  7 11 14:00 ./node_modules/hoge.js/node_modules/huga.js/lib/Huga.js
-rw-rw-rw-  1 foo  Users    7232  7 11 13:03 ./node_modules/tar.js/lib/TarZoo.js
-rw-rw-rw-  1 foo  Users     895  7  4 17:51 ./node_modules/tar.js/test/node/index.js
-rw-rw-rw-  1 foo  Users    8793  7  4 17:45 ./node_modules/tar.js/test/testcase.js
-rw-rw-rw-  1 foo  Users   13039  7  4 17:42 ./node_modules/tar.js/lib/TarBoo.js
-rw-rw-rw-  1 foo  Users   16096  7  4 17:39 ./node_modules/tar.js/lib/Tar.js
-rw-rw-rw-  1 foo  Users   12965  7  4 17:36 ./node_modules/tar.js/lib/TarGoo.js
-rw-rw-rw-  1 foo  Users     953  7  4 02:21 ./node_modules/piyo.js/test/node/index.js

10
9
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
10
9