1.硬链接
ln hello.txt hello_h_link
ln 源文件 链接文件
硬链接是对源文件拷贝,只要修改源文件或硬链接文件,它们会同步变化
注意:不能给目录创建硬链接
2.tar 打包工具
tar -cf hello.tar hello.py hello.txt hhello.txt :打包这几个文件
tar -tf hello.tar:列出压缩文件里面的文件
tar -xf hello.tar:解开打包文件
tar -xvf hello.tar:解开打包文件,并列出解压出的文件名
3.压缩 gzip 对打包的文件进行压缩
1.先使用tar命令打包
2.使用gzip 命令压缩
tar命令结合gzip方式压缩文件:tar -czf hello.tar.gz hello.py hello.txt hhello.txt
tar命令结合gzip方式解压文件:tar -xzf xxx.tar.gz
4.bzip2
tar命令结合bzip2方式压缩文件:tar -cjf hello.tar.bz2 hello.py hello.txt hhello.txt
tar命令结合bzip2 方式解压文件:tar -xjf xxx.tar.bz2
5.zip压缩
zip -r hello 文件1 文件2
6.unzip 压缩
unzip -d hello.zip
几种压缩方式的比较:
压缩率:bzip2>gzip>zip
通用性:zip>gzip>bzip2
一般使用gzip