LoginSignup
0
0

More than 1 year has passed since last update.

特定の文字列を指定フォルダーのファイルを再起的に検索して該当箇所を表示する

Last updated at Posted at 2023-02-21

やりたかったこと

  • 現在のフォルダーの中の全てのファイルの中
  • 拡張子がswiftの
  • Dictionaryの定義を
  • 見つけたらその行を表示

というのをやりたかった

結果としては下記のようなコマンドになった

grep -r -h -n -E "\[.* : .*\]" --include='*.swift' ./ 

下記を参考にした

grepのオプションと、使える正規表現が何があるか
https://bi.biopapyrus.jp/os/linux/grep.html

正規表現の詳細説明
https://userweb.mnet.ne.jp/nakama/
http://www.linux-cmd.com/grep.html

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