马哥教育网络班20期第3周课程练习

答:

1、

[root@totooco ~]# who | cut -c1-9 | sort -u

2、

[totooco@totooco ~]$ who | cut -c1-9 | head -1

3、

[root@totooco ~]# cat /etc/passwd | cut -d: -f7 | grep -v /sbin/nologin | sort -n | uniq -c | head -1

4、

[root@totooco ~]# sort -t: -k3 -nr /etc/passwd | tail -10 | tr 'a-z' 'A-Z' &> /tmp/maxusers.txt

5、

[root@totooco ~]# ifconfig eth0 | grep inet

6、

[root@totooco ~]# ls /etc/*.conf | tr 'a-z' 'A-Z' &> /tmp/etc.test

7、

[root@totooco ~]# ls /var/ | wc -l

8、

[root@totooco ~]# cat /etc/group | sort -n -t: -k3 | head -10 | cut -d: -f1

9、

[root@totooco tmp]# cat /etc/fstab /etc/issue > /tmp/etc.test2

10、

[root@totooco tmp]# groupadd  -g 2016 distro

[root@totooco tmp]# useradd -u 1005 -g 2016 mandriva

[root@totooco tmp]# useradd -u 1005 -g 2016 mandriva

[root@totooco tmp]# echo 'mageedu' | passwd –stdin mageia

[root@totooco tmp]# userdel mandriva

[root@totooco tmp]# useradd -u 2002 -g distro -G peguin slackware

[root@totooco tmp]# usermod -s /bin/tcsh slackware

[root@totooco tmp]# usermod -G admins slackware

[root@totooco tmp]# passwd slackware

[root@totooco tmp]# passwd -n3 -x180 -w3 slackware

[root@totooco tmp]# useradd -u 3003 -g clouds -G peguin,nova openstack

[root@totooco tmp]# useradd -r -s /sbin/nologin mysql

[root@totooco tmp]# echo 'mageedu' | passwd –stdin openstack

原创文章,作者:Net20_totooco,如若转载,请注明出处:http://www.178linux.com/18594

(0)
Net20_totoocoNet20_totooco
上一篇 2016-06-23
下一篇 2016-06-23

相关推荐

  • N25第三周总结

    linux   bassic The third week of blogging 1、列出当前系统上所有已经登录的用户的用户名,注意:同一个用户登录多次,则只显示一次即可。  ~]# who | cut -d' ' -f1 | uniqr…

    Linux干货 2016-12-17
  • 第10天:程序包,脚本,sed

    http://note.youdao.com/yws/public/redirect/share?id=b9432a76ff1180b42e01f6eb7c9fc90e&type=false

    Linux干货 2016-08-18
  • 网络这块一些有趣的感想

    还记的那天老师让我们做两台主机的nexthop就是自己的ip地址,然后互相ping测试能否互相联通的实验,昨晚之后我就在想能不能进行一些改进,因为在我看来这种级别的互相ping的前面一个网络段相同太没意思了。 接着我就尝试了几种IP地址 主机A 主机B 192.0.0.1 192.1.0.1 192.1.1.1 192.2.2.2 192.2.1.1 192…

    Linux干货 2016-09-13
  • 权限管理和文本过滤

    1.复制/etc/skel目录为/home/tuser1,要求/home/tuser1及其内部文件的属组和其它用户均没有任何访问权限 [root@study ~]# cp -r /etc/skel/ /home/tuser1|chmod -R 700 tuser1/ [root@…

    Linux干货 2016-11-20
  • Linux 文 本 处 理 工 具

    Linux 文 本 处 理 工 具 一.学习大纲: ◎各种文本工具来查看、分析、统计文本文件 文件内容查看工具:cat, tac,rev,more,less 文件截取:head和tail 按列抽取:cut,paste 分析文本的工具:wc , sort , uniq,diff和patch 命令使用练习题 ◎文本过滤与处理工具: grep与正则表达式…

    Linux干货 2016-08-05
  • 8.5_Linux文本处理工具和grep之正则表达式的使用

    Linux文本处理工具使用 文件查看工具的使用 cat 命令的使用  此命令一般用于查看文件内容比较多 NAME        cat – concatenate files and print on the&…

    Linux干货 2016-08-08

评论列表(1条)

  • 马哥教育
    马哥教育 2016-06-23 13:54

    不用写答,不过写的很棒,可以在多关注一下排版的技巧,取ip地址好像不对吧