exit 1 和 exit 0 用于退出脚本并返回执行状态(shell中0代表true,非0代表false)。
delimiter >&n # 使用系统调用 dup (2) 复制文件描述符 n 并把结果用作标准输出 <&n # 标准输入复制自文件描述符 n <&- # 关闭标准输入(键盘) >&- # 关闭标准输出 n<&- # 表示将 n 号输入关闭 n>&- # 表示将 n 号输出关闭运算符?
shell 脚本中三个特殊命令:设脚本名称为test.sh,参数三个1,2,3, 运行该脚本:test.sh 1 2 3 后,$* 为“1 2 3”$@为“1” “2” “3”$# 为3(参数数量) linux 目录结构:/usr:软件默认的安装位置, unix software resource的缩写/opt: 大型软件的安装位置/etc: 配置文件, 例如linux中实现日志的服务...
2、split - 划分文件 split 将一个大文件划分成几个较小的文件。(split a file into pieces) 语法:split [OPTION]... [FILE [PREFIX]] 常用组合:split [-d] [-a num] [-l lines] [file [prefix]] -a num,num是创建文件名时用作文件名后缀的字符或数字的数量,默认是aa、ab、ac... -d,(digits...
cd 改变shell的工作目录 dirs 显示目录堆栈信息 popd 从堆栈中移除目录 pushd 向堆栈中添加目录 外部命令列表: 命令名字基本说明 ls 列出目录内容 tree 以"树状"格式列出目录内容 pwd 打印当前工作路径的名字(是一个绝对路径) echo 显示文本行 cat 连接文件内容,并打印到标准输出 tac 连接文件内容,颠倒输出,最后一...
The easiest way to create a literal and make the shell leave a string alone is to enclose the entire string in single quotes, as in this example with grep and the * character: 创建一个字面量并使shell保持字符串不变的最简单方法是将整个字符串用单引号括起来,就像这个例子中使用grep和*字符一...
Place the jobs identified by each JOB_SPEC in the background, as if they had been started with `&'. If JOB_SPEC is not present, the shell's notion of the current job is used. Exit Status: Returns success unless job control is not enabled or an error occurs. ...
-n with -b: don't split multibyte characters --complement complement the set of selected bytes, characters or fields -s, --only-delimited do not print lines not containing delimiters --output-delimiter=STRING use STRING as the output delimiter ...
<<<只是另一种将字符串作为命令输入的方法):如果变量中只有一个字符串,则可以使用shell本身。
在Login Shell...后输入/bin/bash回车 步骤二: 修改/etc/vim/vimrc.tiny 修改set compatible 为 set nocompatible 设置是否兼容 添加set backspace=2 设置 backspace可以删除任意字符 备注: set baskspace=2等同于set backspace=indent,eol,start indent: 如果用了:set indent,:set ai 等自动缩进,想用退格键...