List of basic tar commands
1)tar -cf archive.tar file1 file2
Make archive.tar file of file1 & file2
2) tar -tvf archive.tar
To see what in side the archive.tar without extracting it
3)tar -xvf archive.tar
To extracts the archive.tar file
4) tar -czvf
compress.tgz
To compress the tar with gzip format
5)tar -xzvf compress.tgz
To extract the .tgz file
6)tar -cjvf compress.bz2 file1 file2
Bzip compression of files
7) tar -xjvf compress.bz2
Extract the bzip files
8) tar -cvf archove.tar A*
Only tar files starting with 'A'
9) tar -xvf archive.tar --wildcards
"A*"
Only extracts files starting with 'A' only
10) tar -rvf archive.tar filename
Add filename to archive.tar file without creating fresh tar file
11) tar -cf - * | wc -c
Check the size in bytes witout create tar file
0 Comments