[root@localhost home]# mkdir /home/tomcat
[root@localhost ~]# useradd tom
[root@localhost ~]# id tom
uid=1001(tom) gid=1001(tom) groups=1001(tom)
[root@localhost ~]# usermod -g mail -d /home/tomcat -u 1111 tom
[root@localhost ~]# id tom
uid=1111(tom) gid=12(mail) groups=12(mail)
[root@localhost tomcat]# echo '123456' | passwd --stdin tom
Changing password for user tom.
passwd: all authentication tokens updated successfully.
[root@localhost tomcat]# useradd -c administrator -d /home/admin -e 2022-12-24 -g root -G bin,adm,mail admin
[root@localhost tomcat]# id admin
uid=1112(admin) gid=0(root) groups=0(root),1(bin),4(adm),12(mail)
[root@localhost tomcat]# mkdir /tmp/rhel7
[root@localhost tomcat]# tar -czvf /tmp/rhel7/student.tar.gz /home/
```
gzip 与 bzip2 压缩与解压缩(-d)
这两个指令压缩文件,不能压缩目录
```
[root@localhost rhel7]# touch aa.txt
[root@localhost rhel7]# gzip aa.txt
[root@localhost rhel7]# ls
aa.txt.gz student.tar
[root@localhost rhel7]# gzip -d aa.txt.gz
[root@localhost rhel7]# ls
aa.txt student.tar
[root@localhost rhel7]# bzip2 aa.txt
[root@localhost rhel7]# ls
aa.txt.bz2 home student.tar.gz
[root@localhost rhel7]# tar -xjvf aa.txt.bz2
[root@localhost rhel7]# ls
aa.txt.bz2 home student.tar.gz
[root@localhost rhel7]# bzip2 -d aa.txt.bz2
[root@localhost rhel7]# ls
aa.txt home student.tar.gz
[root@localhost ~]# tail -c 2K /root/initial-setup-ks.cfg
[root@localhost ~]# mkdir -p /share/{teach,office,finance,admin,market}
[root@localhost ~]# cd /share/
[root@localhost share]# ls
admin finance market office teach
[root@localhost share]# mkdir /mnt/cdrom
[root@localhost share]# mount /dev/cdrom /mnt/cdrom/
[root@localhost share]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# vim dvd.repo
[dvd]
name = dvd
baseurl = file:///mnt/cdrom
gpgcheck = 0
enabled = 1
[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum repolist all
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。