上一页 1 ··· 249 250 251 252 253 254 255 256 257 ··· 403 下一页
摘要: 1、创建用户列表 [root@centos7pc1 home]# seq -f liujiaxin%02g 2 10 liujiaxin02 liujiaxin03 liujiaxin04 liujiaxin05 liujiaxin06 liujiaxin07 liujiaxin08 liujiax 阅读全文
posted @ 2022-04-01 15:39 小鲨鱼2018 阅读(1099) 评论(0) 推荐(0)
摘要: 1、linux中if条件判断语句,基本结构: if 条件判断语句 then command fi [root@centos7pc1 test2]# ls test.sh [root@centos7pc1 test2]# cat test.sh ## 脚本文件 #!/bin/bash if [ ! - 阅读全文
posted @ 2022-04-01 09:39 小鲨鱼2018 阅读(6342) 评论(0) 推荐(0)
摘要: 1、查看系统中当前的所有用户 [root@centos7pc1 test2]# grep bash /etc/passwd root:x:0:0:root:/root:/bin/bash liujiaxin01:x:1000:1000:liujiaxin01:/home/liujiaxin01:/b 阅读全文
posted @ 2022-04-01 09:25 小鲨鱼2018 阅读(513) 评论(0) 推荐(0)
摘要: 1、系统 [root@centos7pc1 test2]# lsb_release -a LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-n 阅读全文
posted @ 2022-04-01 09:08 小鲨鱼2018 阅读(3404) 评论(0) 推荐(0)
摘要: 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 阅读(448) 评论(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 阅读(124) 评论(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 阅读(481) 评论(0) 推荐(0)
摘要: 1、行选择 vim file打开文件,在命令模式下输入大写V即可: 按方向键或数字+j/k可以实现行的选择。 2、列选择 vim file打开文件,命令模式下输入ctrl + v即可: 按方向键可以实现列选择。 阅读全文
posted @ 2022-03-29 14:32 小鲨鱼2018 阅读(4040) 评论(0) 推荐(0)
摘要: 1、 删除当前行: dd 删除当前行及向下3行:3dd 或者 d3j 删除当前行及向上3行:d3k 删除当前行及到第1行:d1G 或者 d+gg 删除当前行到最后1行:dG 删除光标所在位置及到行末:d$ 或者D 删除光标所在位置到行首:d0 删除当前字符:x, 相当于delete键 删除当前字符: 阅读全文
posted @ 2022-03-28 22:37 小鲨鱼2018 阅读(2971) 评论(0) 推荐(0)
摘要: 1、Shell 的变量,可以分为“环境变量”和“自定义变量”两种类型,两者的区别在于作用范围不同。环境变量可以在其进程的子进程中继续有效,而自定义变量的势力范围则无法延伸到其进程的子进程中。 [root@localhost test]# ls [root@localhost test]# A=100 阅读全文
posted @ 2022-03-28 21:59 小鲨鱼2018 阅读(269) 评论(0) 推荐(0)
上一页 1 ··· 249 250 251 252 253 254 255 256 257 ··· 403 下一页