摘要: 1、逻辑与&&: 在前面语句执行成功时才执行后面的语句 [root@rhelpc1 test]# ls a.txt [root@rhelpc1 test]# wc -l a.txt 0 a.txt [root@rhelpc1 test]# wc -l a.txt && echo OK ## 逻辑与& 阅读全文
posted @ 2022-03-29 16:27 小鲨鱼2018 阅读(423) 评论(0) 推荐(0) 编辑
摘要: 1、 $0: 当前的shell文件名 $#: 一共包含几个参数 $*: 所有的参数 $?:上一步执行的结果,成功执行返回0,不成功执行返回1或其他 $1: 第一个参数 $2:第二个参数 $3: 第三个参数 测试: [root@rhelpc1 test]# ls test.sh [root@rhelp 阅读全文
posted @ 2022-03-29 15:49 小鲨鱼2018 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 1、测试 [root@rhelpc1 test2]# ls [root@rhelpc1 test2]# seq 10 > a.txt [root@rhelpc1 test2]# ls a.txt [root@rhelpc1 test2]# cat a.txt ## 测试数据 1 2 3 4 5 6 阅读全文
posted @ 2022-03-29 15:46 小鲨鱼2018 阅读(427) 评论(0) 推荐(0) 编辑
摘要: 1、行选择 vim file打开文件,在命令模式下输入大写V即可: 按方向键或数字+j/k可以实现行的选择。 2、列选择 vim file打开文件,命令模式下输入ctrl + v即可: 按方向键可以实现列选择。 阅读全文
posted @ 2022-03-29 14:32 小鲨鱼2018 阅读(3625) 评论(0) 推荐(0) 编辑