1、显示/etc目录下,以非字母开头,后面跟了一个字母以及其它任意长度任意字符的文件或目录
[root@localhost ~]
/etc/1fd
2、复制/etc目录下所有以p开头,以非数字结尾的文件或目录到/tmp/mytest1目录中。
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
pam.d passwd pbm2ppa.conf pki pm popt.d ppp printcap profile.d pulse python
papersize passwd- pinforc plymouth pnm2ppa.conf postfix prelink.conf.d profile protocols purple
3、将/etc/issue文件中的内容转换为大写后保存至/tmp/issue.out文件中
[root@localhost ~]
[root@localhost ~]
\S
KERNEL \R ON AN \M
4、请总结描述用户和组管理类命令的使用方法并完成以下练习:
(1)、创建组distro,其GID为2019;
[root@localhost ~]
[root@localhost ~]
distro:x:2019:
(2)、创建用户mandriva, 其ID号为1005;基本组为distro;
[root@localhost ~]
[root@localhost ~]
mandriva:x:1005:2019::/home/mandriva:/bin/bash
(3)、创建用户mageia,其ID号为1100,家目录为/home/linux;
[root@localhost ~]
[root@localhost ~]
linux mandriva wang
[root@localhost ~]
mageia:x:1100:1100::/home/linux:/bin/bash
(4)、给用户mageia添加密码,密码为mageedu,并设置用户密码7天后过期
[root@localhost ~]
Changing password for user mageia.
[root@localhost ~]
[root@localhost ~]
mageia:$6$VRwwIPQe$2cssILgGEWZtAefWlf9JJmmnEr/Z5u1LBbviynld3qmljbyH7yfMuDmhOyNvYJBtuCJ3MUYIKIsHp5tCINYAv/:18381:0:7:7:::
(5)、删除mandriva,但保留其家目录;
[root@localhost ~]
[root@localhost ~]
linux mandriva wang
(6)、创建用户slackware,其ID号为2002,基本组为distro,附加组peguin;
[root@localhost ~]
[root@localhost ~]
peguin:x:2020:
[root@localhost ~]
distro:x:2019:
[root@localhost ~]
[root@localhost ~]
slackware:x:2002:2019::/home/slackware:/bin/bash
[root@localhost ~]
slackware : distro peguin
[root@localhost ~]
slackware
[root@localhost ~]
peguin:x:2020:slackware
(7)、修改slackware的默认shell为/bin/tcsh;
[root@localhost ~]
[root@localhost ~]
slackware:x:2002:2019::/home/slackware:/bin/tcsh
(8)、为用户slackware新增附加组admins;
[root@localhost ~]
[root@localhost ~]
slackware : distro peguin admins
[root@localhost ~]
admins:x:2021:slackware
[root@localhost ~]
peguin:x:2020:slackware