系统相关
首页 > 系统相关> > vim编辑shell

vim编辑shell

作者:互联网

  vi编辑 u撤销 i输入 dd删除游标所在的那一整行(常用) yy复制游标所在的那一行(常用) p 为将已复制的数据在光标下一行贴上 nyy n 为数字。复制光标所在的向下 n 行,例如 20yy 则是复制 20 行(常用) n查找下一处 /向后搜索?向前搜索 :set nu    显示行号,设定之后,会在每一行的前缀显示该行的行号 :set nonu    与 set nu 相反,为取消行号!   显示行号 输入命令:     set nu 或者     set number 取消显示行号 命令:     set nonu 或者     set nonumber   chown:更改文件属主,也可以同时更改文件属组 chmod:更改文件9个属性     shell脚本流程 if   if condition then     command1     command2     ...     commandN fi   if  else   if condition then     command1     command2     ...     commandN else     command fi   if else-if else   if condition then     command1     command2     ...     commandN else     command fi   for 循环   for var in item1 item2 ... itemN do     command1     command2     ...     commandN done   while 语句 while condition do     command done until 循环 case case 值 in 模式1)     command1     command2     ...     commandN     ;; 模式2)     command1     command2     ...     commandN     ;; esac   break命令continue命令与break命令类似,只有一点差别,它不会跳出所有循环,仅仅跳出当前循环。 case的语法和C family语言差别很大,它需要一个esac(就是case反过来)作为结束标记,每个case分支用右圆括号,用两个分号表示break。 跳出循环

标签:command1,...,shell,command2,vim,编辑,set,case,commandN
来源: https://www.cnblogs.com/h-c-g/p/10722755.html