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构建数据生态系列(二):拆解架构蓝图