File transfer between different systems
1. File archiving
1 File archiving: is to turn multiple files into one archive file
2. tar c creates
f specifies the name of the archive file
t displays the contents of the archive file
r ##Adds to the archive file File
--get ##Remove a single file
--delete ##Delete a single file
x ##Remove all the contents of the archive file
-C ##Specify the unarchived directory-
z ##gz format compression -
j ##bz2 format compression-
J ##xz format compression
2. Compress
gz:
gzip etc.tar is compressed into gz format
gunzip etc.tar.gz Unzip the gz format compressed package
tar zcf etc.tar.gz /etc Archive the file into tar and compress it into gz
tar zxf etc.tar.gz Unzip and unarchive the gz format compressed package
bz2:
bzip2 etc.tar compress into bz2 format bunzip2
etc .tar.bz2 decompresses the bz2 format compressed package
tar jcf etc.tar.bz2 /etc archives the file as tar and compresses it into bz2
tar jxf etc.tar.bz2 decompresses and decompresses the bz2 format compressed package
xz:
xz etc.tar compresses into xz format
unxz etc.tar.xz decompress the xz format compressed package
tar Jcf etc.tar.xz /etc archive the file as tar and compress it into zx
tar Jxf etc.tar.xz decompress and decompress the xz format compressed package
1. File archiving
1 File archiving: is to turn multiple files into one archive file
2. tar c creates
f specifies the name of the archive file
t displays the contents of the archive file
r ##Adds to the archive file File
--get ##Remove a single file
--delete ##Delete a single file
x ##Remove all the contents of the archive file
-C ##Specify the unarchived directory-
z ##gz format compression -
j ##bz2 format compression-
J ##xz format compression
2. Compress
gz:
gzip etc.tar is compressed into gz format
gunzip etc.tar.gz Unzip the gz format compressed package
tar zcf etc.tar.gz /etc Archive the file into tar and compress it into gz
tar zxf etc.tar.gz Unzip and unarchive the gz format compressed package
bz2:
bzip2 etc.tar compress into bz2 format bunzip2
etc .tar.bz2 decompresses the bz2 format compressed package
tar jcf etc.tar.bz2 /etc archives the file as tar and compresses it into bz2
tar jxf etc.tar.bz2 decompresses and decompresses the bz2 format compressed package
xz:
xz etc.tar compresses into xz format
unxz etc.tar.xz decompress the xz format compressed package
tar Jcf etc.tar.xz /etc archive the file as tar and compress it into zx
tar Jxf etc.tar.xz decompress and decompress the xz format compressed package
zip:
zip -r etc.tar.zip etc.tar compress into zip format
unzip etc.tar.zip decompress zip format compressed package
3. File transfer in the system
scp file username@ip:/dir upload
scp username@ip:/ dir/file /dir download
rsync [parameter] file username@ip:/dir
rsync -r sync directory
-l do not ignore links
-p do not ignore file permissions
-t do not ignore file timestamps
-g do not ignore file all groups
-o do not ignore file owners
-D does not ignore device files