You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tar -cvf [newDirectoryName].tar [directoryName]
Exp: tar -cvf archiveEtc.tar etc
Extract Archived Directory
tar -xvf [archivedDirectoryName]
Exp: tar -xvf archiveEtc.tar
Archive + Compression in gz
tar -czvf [newDirectoryName].tar.gz [directoryName]
Exp: tar -czvf archivedEtc1.tar.gz etc
Extract gz format directory
tar -xzvf [archivedDirectoryName].tar.gz
Exp: tar -xzvf archivedEtc1.tar.gz
Archive + Compression in bz2
tar -cjvf [newDirectoryName].tar.bz2 [directoryName]
Exp: tar -cjvf archivedEtc2.tar.bz2 etc
Extract bz2 format directory
tar -xjvf [archivedDirectoryName].tar.bz2
Exp: tar -xjvf archiveEtc2.tar.bz2
Archive + Compression in xz
tar -cJvf [newDirectoryName].tar.xz [directoryName]
Exp: tar -cJvf archivedEtc3.tar.xz etc
Extract xz format directory
tar -xJvf [archivedDirectoryName].tar.xz
Exp: tar -xJvf archiveEtc2.tar.xz
File Compression
gzip file1
bzip2 file2
xz file3
Extract Files
gunzip file1.gz
bunzip2 file2.bz2
unxz file3.xz
Extra things
tar -cvf allfiles.tar file1 file25 file3
tar -tvf allfiles.tar ---> View contents
Archive all the contents in a new directory
------------------------------------------
mkdir new
tar -xvf allfiles.tar -C new