摘要: 配置本地源 [root@localhost ~]# mkdir /yum [root@localhost ~]# mount /dev/cdrom /yum [root@localhost ~]# ls /yum [root@localhost ~]# rm -rf /etc/yum.repos.d 阅读全文
posted @ 2022-03-23 10:19 海月如希 阅读(43) 评论(0) 推荐(0)
摘要: tr,translate的简写,即翻译的意思。主要用来从标准输入中通过替换或删除操作进行字符转换。只接受标准输入,不接受文件参数。 命令语法: tr [–c/d/s/t] [SET1] [SET2] 参数解释: SET1/SET2: 字符集-c: complement,用SET2替换SET1中没有包 阅读全文
posted @ 2022-03-16 15:55 海月如希 阅读(451) 评论(0) 推荐(0)
摘要: #!/bin/bash echo "MY hostname is `hostname`"echo "My IPv4 address is `ifconfig | egrep -w "inet" | head -n1 | tr -s " " ":" | cut -d: -f4` "echo "My K 阅读全文
posted @ 2022-03-16 10:41 海月如希 阅读(150) 评论(0) 推荐(0)
摘要: #!/bin/bash maxuse=`df | grep "/dev/sd" | tr -s " " ":" | cut -d : -f5 | sort -nr | head -n1` echo $maxuse 阅读全文
posted @ 2022-03-16 09:39 海月如希 阅读(124) 评论(0) 推荐(0)
摘要: ss -nt |tr -s " " :|cut -d: -f6|sort | uniq -c |sort -nr 阅读全文
posted @ 2022-03-16 09:23 海月如希 阅读(47) 评论(0) 推荐(0)
摘要: cat /etc/passwd | cut -d: -f1,3,7 | sort -t: -k2 -n | tail -n1 阅读全文
posted @ 2022-03-15 14:47 海月如希 阅读(51) 评论(0) 推荐(0)
摘要: 统计个数: cat /etc/passwd | grep -v /sbin/nologin | wc -l 将符合条件的用户显示出来: cat /etc/passwd | grep -v /sbin/nologin | cut -d: -f 1 阅读全文
posted @ 2022-03-15 14:24 海月如希 阅读(79) 评论(0) 推荐(0)
摘要: [root@Centos8 ~]# useradd user1;useradd user2;useradd user3 [root@Centos8 ~]# mkdir /data/test [root@Centos8 ~]# ls /datatest 1、目录/data/test属主、属组为user 阅读全文
posted @ 2022-03-09 15:28 海月如希 阅读(1167) 评论(0) 推荐(0)
摘要: (1)、创建组distro,其GID为2019; groupadd -g 2019 distro (2)、创建用户mandriva, 其ID号为1005;基本组为distro; useradd -u 1005 -g distro mandriva id mandriva (3) 、创建用户magei 阅读全文
posted @ 2022-03-07 16:58 海月如希 阅读(35) 评论(0) 推荐(0)
摘要: cat /etc/issue | tr '[:lower:]' '[:upper:]' > /tmp/issue.out 阅读全文
posted @ 2022-03-07 15:58 海月如希 阅读(15) 评论(0) 推荐(0)