Create ( Archive) a tar file from a set of files :
tar -cvf tarfile.tar /var/log/samba /var/log/messages
Create a gzip file from a set of files (.tar.gz file):
tar -cvzf file.tar.gz /var/log/samba /var/log/messages
create bzip2 file from a set of files (.tar.bz2 file):
tar -cvjf file.tar.bz2 /var/log/samba /var/log/messages
Display the content of an ordinary tar file:
tar -tvf filename.tar
tar -tvzf filename.tar.gz
tar -tvjf filename.tar.bz2
Extract an ordinary tar file:
tar -xvf filename.tar
tar -xvzf filename.tar.gz
tar -xvjf filename.tar.bz2
Replace a file in an existing tar file:
tar -rvf tarfile.tar filetoreplace
Update a file in an existing tar file:
tar -uvf tarfile.tar newfile
No comments:
Post a Comment