▼Linux
ファイル名で再帰的に検索
find . -name "*" | xargs grep "検索文字"
ファイルの中身検索(フォルダ名は対象外)
grep hoge -rl ./*
行番号が出るのと大文字小文字の区別がない
grep -rin hoge ./*
find . -type f -exec grep -l "hoge" {}\;
サーバ間で設定ファイルを比較するときなど
diff /etc/hoge/hoge.conf <(ssh hogeUser@hostHoge cat /etc/hoge/hoge.conf)
viのハイライトを消す
:noh
時刻
date +'%Y/%m/%d %H:%M:%S'
viで開いているファイルパスと名前を表示する
:echo expand("%:p")
sar -P ALL 2
▼PowerShell
ディレクトリ配下を再帰的に中身検索
Get-Childitem -Recurse | Select-String -Pattern "hoge" -Encoding default
(エクセル内はだめです)
ファイル名の一部分で検索(再帰的)
Get-Childitem -Path <探すフォルダのパス> -Filter "*ファイル名*" -Recurse
[0回]
PR
max_mem_usage=$(vmstat 1 10 | awk 'NR>3 {if ($3 > max) max=$3} END {print max}');echo "最大メモリ使用率: $max_mem_usage"
[0回]
lsb_releaseコマンドでバージョン確認ができます
[0回]
L
問題集
http://jibun.atmarkit.co.jp/scenter/ittrain/102_exam_4_q.html
[0回]
ログシェル
(1)大まかなくくりの時間でfindし、結果をファイルに出力する
(出力先ファイルは作成しなくて良い)
# find ./* | xargs zgrep -i "2013-08-13" >> naka.txt
(2)そのファイルをgrepで複数検索し、結果をファイルに出力する
# grep -i "13:3." naka.txt | grep -i "(APD)" >> hoge.txt
read
http://www.hitachi.co.jp/Prod/comp/soft1/manual/pc/d3S3530/JPAS0297.HTM
特殊文字列削除処理
http://md.atwired.com/?eid=1519120
sed -d 's/[^0-9]//g'
年月を出すには5から7文字目までが必要
http://www5.ocn.ne.jp/~m-shin/basic/basic-shell-script-moji.html
[0回]