用户、组管理、grep、重定向及文本处理习题

用户、组管理、grep、重定向及文本处理习题

1

1.w | cut -d’ ‘ -f1 | uniq

2.grep -E “($(w | cut -d’ ‘ -f1 | tail -1))” /etc/passwd

3.cut -d’:’ -f7 /etc/passwd | uniq -c | sort -n | tail -1

4.grep -E “$(cut -d’:’ -f3 /etc/passwd | sort -n | tail -10)” /etc/passwd > /tmp/test1

tr [a-z] [A-Z] < /tmp/test1

5.ifconfig | grep inet | cut -d’:’ -f2 | cut -d ‘ ‘ -f1 | head -1

6./etc/ | grep -E ‘.*.conf\>$’ | tr [a-z] [A-Z] > /tmp/etc.conf

7.ls /var | wc -w

8.sort -t’:’ -k3 -n /etc/group | tail -10 | cut -d’:’ -f1

9.cat /etc/issue /etc/fstab > /tmp/etc.test

10.[root@localhost ~]# groupadd -g 2016 distro
[root@localhost ~]# useradd -u 1005 -g distro mandriva
[root@localhost ~]# useradd -u 1100 -d /home/linux mageia
[root@localhost ~]# echo ‘magedu’ | passwd –stdin mageia
[root@localhost ~]# userdel mandriva
[root@localhost ~]# groupadd peguin
[root@localhost ~]# useradd -u 2002 -g distro -G peguin slackware
[root@localhost ~]# usermod -s /bin/tcsh slackware
[root@localhost ~]# groupadd admins
[root@localhost ~]# usermod -a -G admins slackware

本文来自投稿,不代表Linux运维部落立场,如若转载,请注明出处:http://www.178linux.com/100860

(0)
radixradix
上一篇 2018-06-11 20:31
下一篇 2018-06-11 21:14

相关推荐

  • 第六周笔记

    进程显示工具 ps -ef(有些人喜欢用)ps 带-不带-不一样a 包括所有终端的进程x 包括不连接的进程u 显示进程所有者的信息f 选项显示树进程 –foresto 属性 选项显示定制的信息 pid,cmd,%cpu,%mem ps xo pid,cmd,%cpu,ttyL 显示支持的属性列表k|–sort 属性 对属性排序,属性前…

    Linux笔记 2018-05-06
  • ansile

    ansible ansible 是一个自动化运维工具,他是基于python语言实现,基于openssh安全的工具 特性: 1)幂等性:一个任务执行1遍和执行n遍效果一样 ,不因重复执行带来意外情况2)无需代理不依赖PKI(无需ssl)3)可使用任何编程语言写模块4)YAML格式,编排任务,支持丰富的数据结构5)较强大的多层解决方案 ansible可以直接由一…

    Linux笔记 2018-06-04
  • 从小白到小白😂

    不知道写啥,用我写的脚本练习题凑凑数

    Linux笔记 2018-04-15
  • 一次完整的http请求处理过程+MPM工作模式

     1、建立连接:接收或拒绝连接请求 2、接收请求:接收客户端请求报文中对某资源的一次请求的过程 Web访问响应模型(Web I/O)单进程I/O模型:启动一个进程处理用户请求,而且一次只处理一个,多个请求被串行响应多进程I/O模型:并行启动多个进程,每个进程响应一个连接请求复用I/O结构:启动一个进程,同时响应N个连接请求实现方法:多线程模型和事件驱动…

    2018-06-24
  • 09葵花宝典Openssl和DNS

    openssl cd bind named

    Linux笔记 2018-05-16
  • 测试

    测试

    Linux笔记 2018-07-22