Creating Archive Files (like tar.gz)

1. For creating Archive file use tar command
Syntax:
tar -cf archivename filenames (seperated with space)

Example :
VIT:/home/antony# tar -cf model.tar sample.c sample2.c

2. For displaying contents of archive file
VIT:/home/antony# tar -tvf model.tar
-rw-r–r– antony/antony 54 2007-09-22 03:10 sample.c
-rw-r–r– root/root 0 2007-09-22 03:12 sample2.c

3. For extracting files from archive
VIT:/home/antony# tar -xf model.tar

Leave a Response