压缩和解压缩

1.zip
zip + 压缩后的文件名字(test.zip) + 要压缩的文件名
zip -m test1.zip test2.txt 把test2 添加到test1.zip
zip -d test1.zip test2.txt 把test2从test1.zip删除掉
zip test1.zip .txt -x test10.txt 除test10以外,将所有。txt的压缩
zip -r /dir 递归压缩
2.unzip(解压缩)
unzip test1.zip
unzip test1.zip -d /压缩目录 (将test1.zip解压到要存储的目录)
unzip -v test1.zip 不解压,查看压缩内容。
3.gzip
gzip + 要被压缩的文件名 压缩后,源文件不保留
gzip -c > test.txt test.txt.gz 压缩,保留源文件
gzip -r 目录 压缩了目录下的所有内容
4.gunzip
gunzip test.txt.gz
gunzip -c test.txt.gz > /root/test.txt 解压缩到特定目录,并且保留源文件
gunzip 相当于 gzip -d
5.bzip2
bzip2 + 要被压缩的文件名 压缩后,源文件不保留
bzip2 -c test.txt > test.txt.bz2 压缩,保留源文件
6.bunzip2
bunzip2 test.txt.bz2
bunzip2 相当于 bzip2 -d
不解压查看 [root@localhost test1]# bzcat test5.txt.bz2
7.xz
xz + 被压缩的文件名 压缩后,源文件不保留
xz dir/

8.unxz
unxz test.txt.xz
xz -d test.txt.xz
xz -d dir/*
9.不解压查看
xzcat test.txt.xz 查看压缩后的文件内容
xless (进去看) zless text5.txt.gz
bzcat
bzless

创建用户与组的练习作业
作业练习
1.
[root@localhost ~]#groupadd mariadb
[root@localhost ~]#useradd -g mariadb -M -s /sbin/nologin -r mariadb
2.
[root@localhost ~]#groupadd -g 5000 nebulaedu
[root@localhost ~]#useradd -d /users/gentoo gentoo
[root@localhost ~]#passwd gentoo
[root@localhost ~]#
3.
[root@localhost ~]#useradd -d /users/fedora
[root@localhost ~]#passwd fedora
4.
[root@localhost ~]#useradd -d /users/www www
[root@localhost ~]#userdel www
5.
[root@localhost ~]#usermod -aG nebulaedu gentoo
[root@localhost ~]#usermod -aG nebulaedu fedora
6.
[root@localhost ~]#cp -p /var/log /tmp/
[root@localhost ~]#chgrp nebulaedu /tmp/log

权限练习
1.
[root@localhost ~]#groupadd A
[root@localhost ~]#groupadd B
[root@localhost ~]#useradd -g A david
[root@localhost ~]#useradd -g A peter
[root@localhost ~]#useradd -g B jack
[root@localhost ~]#useradd -g B mike
[root@localhost ~]#mkdir /project_a
[root@localhost ~]#setfacl -m d:u:david:rwx /project_a/
[root@localhost ~]#setfacl -m d:u:peter:rwx /project_a/
[root@localhost ~]#setfacl -m d⭕️:— /project_a
[root@localhost ~]#setfacl -m g:A:r-- /project_a
2.
[root@localhost ~]#mkdir /project_b
[root@localhost ~]#setfacl -m g:B:rwx /project_b/
[root@localhost ~]#setfacl -m o::— /project_b/
[root@localhost ~]#chmod o+t /project_b/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值