0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ファイル名で検索した時にファイル内の行数を取得しソートして表示する

Last updated at Posted at 2020-01-07
find ファイルパス -name "ファイル名" |  xargs wc -l | sort
  • find ファイルパス -name "ファイル名" ファイルパス配下に合致するファイル名を検索する
  • wc -l 改行数
  • sort 入力内容をソートして出力

テストファイルの行数を昇順に出力する

find ./ -name "*.test.ts" | xargs wc -l | sort
出力例
25 ./backend/src/utils/__test__/objects.test.ts
26 ./backend/src/utils/__test__/logger.test.ts
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?