1.查殺進程,舉firefox為例
#ps -e | grep firefox | cut -d"?" -f1 | xargs kill
2.svn 清除conflict檔案
#svn status | grep ^C | sed 's/^C[ ]*/\.\//g' | xargs rm -f
#svn up
3.關鍵字多檔案替換(執行個體為Joomla1.5 mtree組件在php5.3下的相容問題)
#cd /var/www/joomla15/components/com_mtree/Savant2/
#sed -i "s/function plugin(\s*&/function plugin(/g" `grep 'function plugin' -rl ./`
意思為Savent2目錄下所有檔案中,將function plugin(& 替換為function plugin(,即將形參的&去掉,
否則php5.3+會提示行參加&的引用傳遞方式已經不被推薦,只需實參直接傳入即可。
4.vim設定自動補全
首先確認是vim7+,且存在autoload目錄,裡面是各種代碼補全vim代碼,比如pythoncomplete.vim,javascriptcomplete.vim,諸如此類檔案
然後在vimrc設定檔裡加入一行
setlocal omnifunc=syntaxcomplete#Complete
表示vim會自動根據當全檔案類型,尋找相應檔案的補全檔案
最後開啟某個檔案,比如php檔案,在<?php ?>標籤內輸入一個函數的前幾個字元,比如mysql,然後Ctrl+x,Ctrl+o。
5.pdf 轉 jpg,ghostscript很強大,不過命令太難記了。
gs -SDEVICE=jpeg -r600x600 -sPAPERSIZE=letter -sOutputFile=/home/lake/Downloads/st_%04d.jpg -dNOPAUSE -dBATCH -- /home/lake/Downloads/st.pdf