Connect me on social media 👉
Instagra👉www.instagram.com/durgesh_kumar_14918/
🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏
Thanks you
============================================================
Archive copy files between systems:
It is useful to store a group of files in one file for easy backup, for transfer to another
directory or for transfer to another computer.
Archive file is a collection of files and directories stored in one file.
Archive files:
Archive file is a collection of files and directories that are stored in one file.
The Archive file is not compressed, it uses the same amount of disk space as all the
individual files and directories combined.
A compressed file is a collection of files and directories that are stored in one
file and store in a way that uses less disk space than all the individual files
and directories combined.
An archive file is not compressed but compressed file can be an Archive file.
Tar command:
The Linux ‘tar’ stands for tape archive,
is used to create Archive and extract the Archive files.
tar command in Linux is one of the important command which provides archiving functionality
in Linux. We can use Linux tar command to create compressed or uncompressed
Archive files and also maintain and modify them.
This is good way to create backup and archive.
The tar command does not compress the files by default. arching and compressing
files are useful when creating backups and transferring data across the network.
Compression tool:
Th archive can be compressed by using tools gzip ,bzip2 or xz.
Gzip compression is most frequently used to create .tar.gz or .tgz. Files.,
Tar command also support bzip2 and xz compression.
This allows you to create bzip2 compressed files, often named .tar.bz2,. Or .tar.bz Or .tbz ,
Options:
-c : Creates Archive
-x : Extract the archive
-f : creates archive with given filename
-t : displays or lists files in archived file
-u : archives and adds to an existing archive file
-v : Displays Verbose Information
-A : Concatenates the archive files
-z : zip, tells tar command that creates tar file using gzip
-j : filter archive tar file using tbzip
-W : Verify a archive file
-r : update or add file or directory in already existed .tar file
c= create
v= view
f= file name
x= extract
t= to show content
desktop]# touch f1 f2 f3 f4
#mkdir dir1 dir2 dir3
#tar cvf f1.tar f1 ----to create tar of f1 [c=create, v=view, f=file name]
#tar tvf f1.tar f1 ----f1.tar is name of tar/ t is use to list content of archie
#tar cvf more.tar f1 f2 f3 f4 -----to create tar of f1 f2 f3 f4 / more.tar is name of tar
#tar tvf f1.tar f1 f2 f3 f4 ----use to show content
cd
-rw rw-rw kali kai
#tarrmf more.tar -----to extract where we are [x=extract]
or
#tar xvf more.tar -C/root/Desktop/a/ -----to extract at given path[C is capital]
--------------------------------------------------------------------------
#tar cvf dir1.tar dir1 ------to create tar of directory with name dir.tar
#tar cvf dir.tar dir1 dir2 dir3 ------to create tar of dir1 dir2 dir3
#tar tvf dir.tar ------to see created tar
drwxrwxr-x root root
#la -l or ls -lh
#tar xvf dir.tar -------command to ectract where we are
#tar xvf dir.tar -C/home/root/ ------command to extract at given path
-----------------------------------------------------------------------------------
yum install gunzip
1]
#gzip f1 ---------to compress f1 and create zip of that at that location/ size may reduce/ gzip is fast but compress more
#gunzip f1.gz ----------to unextraxt of gzip [.gz is extention ]
or
gzip -d f5 ------to extract
2]
#bzip2 f2
#bzip2 -d f2 ---------bzip is slower but compression is less
or
#bunzip2 f2.bz2 ---------to unextraxt
3]
#xz f3 ----------to zip with zx
#unxz f3.xz ----------to unzip zx
----------------------------------------------------------------------------------
#tar cvjf f4.tar.gz f4 --------command to create tar as well as compress with gz
#tar xvjf f4.tar.gz f4 --------command to extract
#tar cvJf f4.tar.bz2 f4 --------command to create tar as well as compress with bzip
#tar xvJf f4.tar.bz2 f4 --------command to extract
#tar cvzf f4.tar.xz f4 --------command to create tar as well as compress with xz
#tar xvzf f4.tar.xz f4 --------command to extract
-----------------------------------------------------------------
How To Create Archive And Compress Files In Linux | How do I create a compressed archive in Linux?
How do you create an archive file in Linux?
Which is used to create compressed archive files in Linux?
Which command is used to compress and archive files together?
How do you create an archive file?
How do I compress
コメント