make Symbolic Link: シンボリックリンクの作成
シンボリックリンクの作成
$ ln -s <filepath> <linkname>
現在のパスの表示
$ pwd :シンボリックリンクをそのまま表示
$ pwd -P :シンボリックリンクをたどる
Replace strings for files :一括文字列置換
non git
$ find . -type f -print0 | xargs -0 sed -i -e 's/foo/bar/g'
git directory
$ git ls-files -z | xargs -0 sed -i -e 's/foo/bar/g'
<補足:"print0|xargs -0">
http://qiita.com/maskedw/items/2dfdf6fa7eee991ddc45
xargsが空白文字でなくヌル文字を区切りとして扱うように-0を指定し、
xargsの形式に合わせるためにfindの-print0を指定する
Replace URL:URLの置換
replace http://OLDURL > http://NEWURL
# find -type f | xargs grep -l 'http://OLDURL'|xargs sed -i "s,http://OLDURL,http://NEWURL,g"
Find "string" under current directory :
$find -type f|xargs grep -l "string"
Option -l : only file name
Find recently updated file : 最近更新したファイル
$ find -type f -mtime -1|xargs ls -l
Option -mtime : -1= 1day before