Linux七天系列------之一
发布日期:2021-06-30 16:21:31 浏览次数:2 分类:技术文章

本文共 2239 字,大约阅读时间需要 7 分钟。

1、文件压缩与解压

 

gzip

 

特点:
1.只能压缩文件,不能压缩目录
2.不保留源文件

[nxuser@PSjamsBond-0-0-0 ~]$ ls

ISO  OSupgrade_3.1.tgz  Patches  alu-sipp  hardlinksource  installUrl  java  softlink.txt  ssh_config  tli001  tmp  yvette
[nxuser@PSjamsBond-0-0-0 ~]$ gzip  softlink.txt
[nxuser@PSjamsBond-0-0-0 ~]$ ls
ISO  OSupgrade_3.1.tgz  Patches  alu-sipp  hardlinksource  installUrl  java  softlink.txt.gz  ssh_config  tli001  tmp  yvette

 

tar:

[nxuser@PSjamsBond-0-0-0 ~]$ tar  -zcvf  tli001.tar.gz tli001/

tli001/
tli001/alu-sipp.tar
tli001/alu-sipp/
tli001/alu-sipp/sipp
[nxuser@PSjamsBond-0-0-0 ~]$ ls
ISO                Patches   hardlinksource  java             ssh_config  tli001.tar.gz  tmp.tar.gz
OSupgrade_3.1.tgz  alu-sipp  installUrl      softlink.txt.gz  tli001      tmp            yvette
[nxuser@PSjamsBond-0-0-0 ~]$ tar  -zcvf tli001.aa  tli001
tli001/
tli001/alu-sipp.tar
tli001/alu-sipp/
tli001/alu-sipp/sipp
[nxuser@PSjamsBond-0-0-0 ~]$ ls
ISO                Patches   hardlinksource  java             ssh_config  tli001.aa      tmp         yvette
OSupgrade_3.1.tgz  alu-sipp  installUrl      softlink.txt.gz  tli001      tli001.tar.gz  tmp.tar.gz

注意:
在linux下扩展名不是标识文件的属性
 
tar.gz 和tgz 是一样的,用tar命令解压即可

 

zip 
功能:可以压缩文件和目录,是windows 和linux 通用的压缩格式
 
[root@localhost test]# zip a.zip  a                     把a文件压缩成a.zip
[root@localhost test]# zip -r tatgz.zip tatgz      压缩tatgz目录为tatgz.zip
[root@localhost test]# unzip  tatgz.zip              解压文件
 
 
bzip2 
gzip功能基本相同
只能压缩文件
用 -k 命令可以保留原文件 
[root@localhost bzip2]# bzip2 -k fnngj  对fnngj文件进行压缩 
[root@localhost bzip2]# bunzip2  fnngj.bz2   对压缩文件fnngj.bz2进行解压
 
查看文件类型
[nxuser@PSjamsBond-0-0-0 ~]$ file tli001.aa
tli001.aa: gzip compressed data, from Unix, last modified: Tue Mar 19 09:54:32 2013
 
2、通信命令
 
 
write
发给某个用户信息
 
 
wall
发给所有使用系统的用户
 
[nxuser@PSjamsBond-0-0-0 ~]$ su -
Password:
Last login: Tue Mar 19 10:13:54 CST 2013 from station_a on ssh
No mail for root
Term type is now vt100
PSjamsBond-0-0-0:/root-# write  nxuser
hello
fuck
comeon

 

 

 

[nxuser@PSjamsBond-0-0-0 ~]$

Message from (as root) on pts/1 at 10:14 ...
hello
fuck
comeon
EOF

PSjamsBond-0-0-0:/root-# ping
PING (119.75.218.77) 56(84) bytes of data.
64 bytes from 119.75.218.77: icmp_seq=1 ttl=35 time=691 ms
64 bytes from 119.75.218.77: icmp_seq=2 ttl=35 time=661 ms
^C
--- ping statistics ---
3 packets transmitted, 2 received, 33% packet loss, time 2548ms
rtt min/avg/max/mdev = 661.358/676.671/691.985/15.335 ms
PSjamsBond-0-0-0:/root-# ifconfig

转载地址:https://kerry.blog.csdn.net/article/details/8690251 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:linux七天系列之二
下一篇:Linux中profile、bashrc、bash_profile之间的区别和联系 .

发表评论

最新留言

感谢大佬
[***.8.128.20]2024年04月19日 04时24分11秒