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
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 {} \;
記錄一下這幾個連結 http://tldp.org/LDP/Bash-Beginners-Guide/html/index.html http://ppewww.physics.gla.ac.uk/~chrisc/SUPA/lecturenotes/bash/bash.html 常有機會寫 bash 但是bash還是不熟悉.
[root@cluster1 ~]$ top -b -n 1 |sed -n -e “8,`cat /proc/cpuinfo | grep processor | tail -n 1 | awk ‘{print $3 …
[root@cluster1 ~]$ cat /proc/cpuinfo | grep processor | tail -n 1 | awk ‘{print $3 + 1}’
ssh bc$((` hostname -s| awk -F “” ‘{ print $3$4 }’` + 14))
grep “Failed password for invalid user” /var/log/secure | awk ‘{print substr($13,8)}’ | awk ‘{count[$1]++} END { for( i in count ) { …
[root@bt1 ~]# for ((i=1;i<=14;i+=1)); do scp -r /etc/krb5.conf bc$i:/etc/; done
ps | grep test | awk ‘{print $1}’ | xargs kill