刪除正在使用某 port 的程式
# fuser -k 8080/tcp
bash – report_jobs
以前的工作內容 XD report_jobs
linux 移除註解指令
# grep -o ‘^[^#]*’ FILENAME
To convert flac to m4a by using ffmpeg on Mac OS X
first, download ffmpeg (http://www.ffmpegmac.net/) for mac os x binary. you could use the following command to convert : # ffmpeg -i xxxxx.flac …
清除正在使用 lustre 檔案系統的程式
# lsof|grep lustre|awk ‘{print $2}’|xargs kill
bash 隨機睡幾秒 範例
sleep $[ ( $RANDOM % 60 ) + 1 ]s
bash 批次轉 .jpg 檔案為 .pdf
1 for i in ls *.jpg; do convert -verbose "$i" ${i%\.*}.pdf; donefor i in ls *.jpg; do convert -verbose "$i" ${i%\.*}.pdf; done
將目錄內所有的某附檔名遞迴移除
例如我要將桌面內所有 .wma 檔案遞迴移除. 可以用下列指令 : find ~/Desktop/ -name *.wma -exec rm -v {} \;
Bash Guide for Beginners
記錄一下這幾個連結 http://tldp.org/LDP/Bash-Beginners-Guide/html/index.html http://ppewww.physics.gla.ac.uk/~chrisc/SUPA/lecturenotes/bash/bash.html 常有機會寫 bash 但是bash還是不熟悉.