789
技術社區[雲棲]
linux shell 指令好記速查
1.訪問變量要加$
a=100
echo $a
2.read a #將用戶輸入內容放入a
3.參數
$0 腳本名字,$# 參數個數,$$ shell腳本進程號,$1...$n 具體參數
$*,$@ 全部參數,前者以$IFS分隔
4.test或者[]
if test -f xxx.c;then #or [ -f xxx.c ]
...
fi
5.if [cond0] || [cond1] && [cond2];then elif else fi
6.for i in ... do ... done
7.while cond do ... done
8.until cond do ... done
9.case val in
cond1_a | cond1_b) ...;;
cond2)...;;
esac
10.多個語句 {}
11.函數 foo() {local xxx = xxx;return xxx}
12.break,continue,
13, :號 , true的別名
14. 符號.在當前shell中執行命令
15.對參數求值 eval
16.exec將當前shell換為其他程序
17.expr將參數作為表達式求值
18.set|unset為shell設置|刪除參數變量
19.shift將所有參數左移一位
20.trap信號處理
21.find [path] [options] [tests] [actions]
22.$()|``將命令以字符串方式返回
23.$((...)),${}參數擴展
24.$?上一命令的退出狀態
最後更新:2017-04-04 07:03:25
上一篇:
Android: Gallery的adapter中getView方法被執行多次
下一篇:
android Handler應設為static
我理解的“前端架構”(來自2014年)
Linux Deepin:中國 Linux 桌麵界的正能量
當 Kubernetes 遇到阿裏雲 之 快速部署1.6.1版本
阿裏90後工程師,如何用AI程序寫出雙11打call歌?
Couldn't get connection because we are at maximum connection count (150/150) and there are none 異常解決
Something More about "new" &"delete" in C++
c# 命名空間、dll、與函數
網絡子係統86_inet協議族-l4向下(一)
MaxCompute常用語句匯總(更新ing)
從0到1構建數據生態係列(二):拆解架構藍圖