LoginSignup
9
9

More than 5 years have passed since last update.

よく使うけどよく忘れるコマンド備忘録

Last updated at Posted at 2015-09-27

silver shearcher

早いgrep

インストール

項目 コマンド
ubuntu sudo apt-get install silversearcher-ag
homebrew brew install ag #error

コマンド

項目 コマンド
ファイルの内容で検索 ag {word} {folder or file(s)}
ファイル名で検索 ag -g {fileName}
一致したファイル名のみで検索 ag -l {fileName}
一致していないファイル名のみで検索 ag -L {fileName}
正規表現を無視 ag -Q {word}
特定のファイルのみ検索 ag checkbox_label -G \.js$
特定の拡張子を持ち特定のワードを含むファイルの検索 ag -L google -G \.less$
正規表現 ag "require\( './actions/"

オプション

オプション 意味
-a 無視リストも対象
-u 隠しファイルおよび無視リストも対象
-g ファイル名で検索
-G 検索対象の指定 [ag -G *.css]
-l 一致したファイル名のみ表示
-L 一致していないファイル名のみ表示
-v 不一致検索
-Q 正規表現を無視
-z 圧縮ファイルも対象
-S 大文字小文字も曖昧に検索

lsof

プロセスが使用しているポート

lsof -i

ポート番号から

lsof -i:3000

参考文献

http://chaika.hatenablog.com/entry/2015/01/26/161538
http://qiita.com/0829/items/7053b6e3371592e4fbe6
http://hail2u.net/blog/software/ag-capital-g-cli-option.html

https://qiita.com/sonoshou/items/cc2b740147ba1b8da1f3

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