1. 程式人生 > >Linux Shell Cheat Sheet

Linux Shell Cheat Sheet

1. 檢視Linux作業系統資訊:

uname -a

cat /proc/version

lsb_release -a

 

2. 設定ls顯示的資料夾的顏色(將下面這條目錄加在 .bashrc 檔案最後):

LS_COLORS=$LS_COLORS:'di=0;35:' ; export LS_COLORS

(All possible colors:
31  = red
32  = green
33  = orange
34  = blue
35  = purple
36  = cyan
37  = grey
90  = dark grey
91  = light red
92  = light green
93  = yellow
94  = light blue
95  = light purple
96  = turquoise

97  = white)

 

3. 在遠端伺服器X Server上顯示圖形介面

ssh -x [email protected]

 

4. 強制轉換影象大小

convert -resize 1056x640! 000456.jpg 000456_640_1056.jpg

 

5. 檢視影象資訊

file 000456_640_1056.jpg

identify 000456_640_1056.jpg

 

6. 檢視物理CPU的個數

cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l 

 

7. 檢視邏輯CPU的個數

cat /proc/cpuinfo |grep "processor"|wc -l 

 

8. 檢視一個物理CPU是幾核

cat /proc/cpuinfo |grep "cores"|uniq

 

9. 檢視當前目錄大小

du -h --max-depth=1 ./