2012-03-26
DevLOVE ターミナル勉強会「オレの*_historyが火を吹くぜ!」を覗いてきた
内職しながら、3月26日 DevLOVE ターミナル勉強会「オレの*_historyが火を吹くぜ!」(東京都) を覗いてきた。
今日の収穫は「grep -A -B -C」。恥ずかしながら知りませんでした。キーワードにヒットした行の前X行、後X行、前後X行を表示とかできるんですね。
キーワードにヒットした行の後ろ2行を表示する。
% grep -A2 50 * foo.txt:50 foo.txt-51 foo.txt-52
キーワードにヒットした行の前2行を表示する。
% grep -B2 50 * foo.txt-48 foo.txt-49 foo.txt:50
キーワードにヒットした行の前後2行を表示する。
% grep -C3 50 * foo.txt-48 foo.txt-49 foo.txt:50 foo.txt-51 foo.txt-52
以下はかなり断片的な自分用メモ。
「誰得コマンド&オプション35連発」 by @yoozoosato さん
発表資料はコチラ → 誰得コマンド&オプション35連発
35個のコマンドを紹介されました。
less -N less -> F less -> v df -l df -H ps w wget --random-wait (-r と一緒に) wget --spider (-S と一緒に) tcpflow -c -l enl -e -port 80 cd - ls -lh ls -lT open -R (Mac OS X) open -g (Mac OS X) sed -i cp -p file -I tar -p tar -j tar -C zcat zgrep bzcat wc cal -y chown group:owner ... su - gtags screen; kanji nmap
35個ない、ちょっとメモ漏れましたが、発表資料が公開されているので無問題。
「LLでWEBをやっていると、Terminal は避けて通れない。」「Editor、Browser、Terminal は三種の神器」と締めくくられていました。
「カジュアルにターミナルを」 by @masasuz さん
発表資料はこちら → http://masasuzu.github.com/slide/build/2012-03-26_devlove_terminal.html
- Terminal は mintty を使っている
- キーバインド
set -o vi set -o emacs
fc コマンドでコマンドをエディタで編集できる。 vimdiff で diff して編集 vim -R で読み込み専用モードで開く grep -r grep -A -B -C grep --exclude-dr grep --color grep -v grep -w -x grep -c grep -l -L GREP_OPTIONS 変数 export LANG=C man grep ack (cpan App::Ack)
grep -A -B -C は知らなかった(^-^;
手元の Cygwin で確認してみたところ、man に書いてますた。
% man grep ... Context Line Control -A NUM, --after-context=NUM Print NUM lines of trailing context after matching lines. Places a line containing a group separator (--) between contiguous groups of matches. With the -o or --only-matching option, this has no effect and a warning is given. -B NUM, --before-context=NUM Print NUM lines of leading context before matching lines. Places a line containing a group separator (--) between contiguous groups of matches. With the -o or --only-matching option, this has no effect and a warning is given. -C NUM, -NUM, --context=NUM Print NUM lines of output context. Places a line containing a group separator (--) between contiguous groups of matches. With the -o or --only-matching option, this has no effect and a warning is given.
「SSH Tips & Tricks」 by @nobu666 さん
発表資料はこちら → SSH Tips & Tricks
ssh のお話でした。ssh ってこんなに機能があったとは知らなかった。
- Port Forwarding が便利そうだと思った。
ssh -Nf -L80:HOST:80 GATEWAY ssh -Nf -LI3306:HOST:3306 GATEWAY
- rsync --partial
- sshfs
- トラブルシューティングのときは
「ssh があればなんでもできる」「Let's "man ssh_config"」と締めくくられていました。
最後に @ShougoMatsu さんが飛び込み LT で vimshell を紹介されていました。
トラックバック - http://d.hatena.ne.jp/yohei-a/20120326/1332766807
リンク元
- 474 http://www.google.co.jp/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CDEQFjAA&url=http://d.hatena.ne.jp/yohei-a/20100412/1271052985&ei=mg5wT67XB6T4mAXM_pieBg&usg=AFQjCNEq0MH1OPEOKytd1yc7Dg8Sv8n3Xg
- 209 http://www.google.co.jp/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0CC8QFjAB&url=http://d.hatena.ne.jp/yohei-a/20101224/1293209750&ei=bBJwT6_cMK_vmAXpsYWjBg&usg=AFQjCNExFi0gkEQPnV5udebOewevke1g7w&sig2=ZKYdZufz6rFbQ1drJYYk7Q
- 186 http://www.google.co.jp/url?sa=t&rct=j&q=&esrc=s&frm=1&source=web&cd=1&ved=0CDQQFjAA&url=http://d.hatena.ne.jp/yohei-a/20100106/1262763412&ei=Dg5wT6eZBobFmQWV6uS5Bg&usg=AFQjCNEC-_GSMNV9zqaj8qHwu_HebGjEog&sig2=dgBvY7KTSOB7el3e3FhS9Q
- 145 http://www.google.co.jp/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&ved=0CD4QFjAC&url=http://d.hatena.ne.jp/yohei-a/20090713/1247467127&ei=UhNwT6fsHOXUmAWHvbmVBg&usg=AFQjCNFeuTSGFqftGSfJ2iBD7IKzngiLkA
- 97 http://www.google.co.jp/url?sa=t&rct=j&q=&esrc=s&source=web&cd=4&ved=0CEMQFjAD&url=http://d.hatena.ne.jp/yohei-a/20090529/1243618987&ei=kBtwT6KBPO_1mAWk9dmUCQ&usg=AFQjCNFMWWXGfYRhcuBKLH3GzGb2ZZUQAg&sig2=jWbPvVTMF-_iijry7PSvcw
- 65 http://www.google.co.jp/url?sa=t&rct=j&q=&esrc=s&source=web&cd=5&ved=0CEIQFjAE&url=http://d.hatena.ne.jp/yohei-a/20100106/1262763412&ei=2BVwT_eJCu_ymAXLvK28Bg&usg=AFQjCNEC-_GSMNV9zqaj8qHwu_HebGjEog&sig2=nCNYPzpGEQvZ7KAkzQjIgA
- 54 http://www.google.co.jp/url?sa=t&rct=j&q=&esrc=s&source=web&cd=6&ved=0CHAQFjAF&url=http://d.hatena.ne.jp/yohei-a/20100418/1271585933&ei=hBZwT_j4GcTDmQWb2_inBg&usg=AFQjCNEJviG8sc_otPaO8r76-G9oNpZiKg&sig2=7CjV_LWz8lcyr5ujrr-zLQ
- 50 http://d.hatena.ne.jp/notify-NotifyUser_POST_NG_CATEGORY?aHR0cDovL2QuaGF0ZW5hLm5lLmpwL3lvaGVpLWEvMjAxMDEyMTUvMTI5MjQyOTgxMw==
- 47 http://www.google.co.jp/search?sourceid=navclient&hl=ja&ie=UTF-8&rlz=1T4GGHP_jaJP466JP467&q=ORA-29283:+invalid+file+operation
- 34 http://www.google.co.jp/hws/search?hl=ja&client=fenrir&channel=&adsafe=off&safe=off&lr=all&q=最大ユーザー・プロセス+oracle インストー%E
