scp --- remotely copy files
to upload files
scp file user @ ip: / file
downloading files
scp user @ ip: / file file
rsync --- remote synchronization, speed blocks, ignores the default file attributes, linked files, device files
-r --- synchronize directories
-p --- synchronization rights
-o --- synchronize files owner
-g --- synchronize files all groups
-D --- Synchronous device file
-l --- soft link file synchronization
-t --- synchronization file timestamps
Experiment specific operation
recursive directory synchronization
recursive directory synchronization test, perform synchronous read and write permissions
Everyone was given directory test student, recursive directory synchronization, perform read and write permissions, file owner
recursive directory synchronization test, perform read and write permissions, file owners, all the groups, the time stamp
given test directory owner to student, recursive directory synchronization, perform read and write permissions, file owners, all group
test to create a soft link to the directory d1, recursive directory synchronization, perform read and write permissions, file owners, all the groups, soft links directory
tar --- archive (to package a number of files into one file)
-c --- 创建
-x --- 解档
-v --- 显示过程
-f --- 指定归档文件名称
-t --- 查看归档文件内容
-r --- 添加文件到归档中
--get --- 解档指定文件
--delete --- 删除归档中的指定文件
-C --- 指定解档目录
实验具体操作
创建文件file1到10,打包并命名file.tar
创建文件f1,并添加到file.tar包中,查询包内文件
指定解压file.tar包中文件f1,查询当前目录内容
删除file.tar包中文件file1,查询包内文件
解包file.tar包中文件到指定目录/mnt下并查看/mnt下内容
文件压缩后占用的空间变小,节省磁盘空间
常见的压缩文件:
Windows .rar .zip .7z
Linux .zip .gz .bz2 .xz
注 只有zip支持压缩目录,其他文件只能压缩包文件
zip 压缩工具
查看当前目录内容,压缩所有文件命名为filetest.zip
删除文件file1到9,查看当前目录内容,解压压缩文件filetest.zip,并查看当前目录内容
gz压缩工具
压缩包文件file.tar, 查看当前目录内容,解压压缩文件filetest.tar.gz,查看当前目录内容
bz2压缩工具
压缩包文件file.tar, 查看当前目录内容,解压压缩文件filetest.tar.bz2,查看当前目录内容
xz压缩工具
压缩包文件file.tar, 查看当前目录内容,解压压缩文件filetest.tar.xz,查看当前目录内容
tar不仅具备打包能力也可直接压缩打包文件,等同于gz,zb2,xz压缩工具
Gz z option is equivalent to the compression tool
options j equal to zb2 compression tool
options equivalent to the xz compression tool J