马哥教育网络班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 10:56
下一篇 2016-06-23 10:58

相关推荐

  • 模块化的php编译amp和fpm化的php编译amp;

    编译安装amp 一,编译环境前准备工作 (1) 系统环境:CentOS 6,7     CentOS 6:apr, apr-util的版本为1.3.9,不适用于httpd-2.4;     CentOS 7:apr, a…

    Linux干货 2016-10-17
  • shell脚本变成之数组、字符串处理及其它功能补充

    数组定义:                  能够存储多个元素的内存空间,每个元素在数组中具有特定的索引编号,我们可以通过变量名和索引编号来查看数组中的某一元素。    &nbsp…

    Linux干货 2016-08-24
  • N25-第18周博客作业

    1、为LNMP架构添加memcached支持,并完成对缓存效果的测试报告; LNMP的安装过程不再赘述. # yum install -y memcached # cat /etc/sysconfig/memcached  PORT=”11211″   &nb…

    2017-05-21
  • 终于成为马帮的成员了

    终于成为马帮的成员了

    Linux干货 2016-09-18
  • RAID实现原理及常用级别

    RAID(Redundant Array of Independent Disks): 定义:独立硬盘冗余阵列,旧称廉价磁盘冗余阵列(Redundant Array of Independent Disks),简称磁盘阵列。 原理:把多个相对便宜的硬盘组合起来,成为一个硬盘阵列组,使其性能达到甚至超过价格昂贵,容量巨大的硬盘。 优势: RAID在容量和管理上…

    Linux干货 2016-07-22
  • 文件的查找作业

    1、查找/var目录下属主为root,且属组为mail的所有文件 2、查找/var目录下不属于root、lp、gdm的、所有文件 3、查找/var目录下最近一周内其内容修改过,同时属主不为root,也不是postfix的文件 4、查找当前系统上没有属主或属组,且最近一个周内曾被访问过的文件 5、查找/etc目录下大于1M且类型为普通文件的所有文件 6、查找/…

    Linux干货 2016-08-15

评论列表(1条)

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

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