Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

Archive , Compress and transfer files

Archive Backup
Compress Save space

Create - List - Extract

Command Archive Only


tar c create t list x extract v verbos f file
# tar cvf arch1.tar file*
# tar tf arch1.tar
# tar xvf arch1.tar
-----------------------------------------------------------------------------------
-----
Command Compress Only replace file with compressed one
gzip
# gzip -v file1
# zcat file1.gz
# zmore file1.gz
# less file1.gz
# gunzip -v file1.gz

app1.tar.gz
LibreOffice_7.5.1_Linux_x86-64_rpm.tar.gz

bzip2
# bzip2 -v file2 create
# bzcat file2.bz2 list
# bzmore file2.bz2 list
# less file2.bz2 list
# bunzip2 -v file2.bz2 extract
-----------------------------------------------------------------------------------
----
Command Archive + Compress
zip

# zip -v arch1.zip file*


# unzip -l arch1.zip
# unzip arch1.zip
# unzip arch1.zip -d /root/Documents/
-----------------------------------------------------------------------------------
----
transfer files
scp ssh 22
# scp file1 root@10.0.0.2:/root upload

# scp root@10.0.0.2:/root/script100 /root download


-----------------------------------------------------------------------------------
-----
Q13.create an archive '/root/backup.tar.bz2' of '/usr/local' dir and compress it
with bzip2.

You might also like