CentOS Linux Server Guide

File archiving using tar command in CentOS Linux

Tar

  • tar, command to compress and archive multiple files into one single backup file

  • File compressed under tar, will have .tar  extension.

Command name

tar

 

Synopsis

tar [option]  tar_filename.tar  original_folder_or_file_name

 

Option

-c  create a tar file

-v  debugging mode, showing detail output

-f   specify an archive file

 

Note

The sequence of of tar must be correct.

 

Example
tar cvf archive.tar /var/log/messages /var/log/maillog
tar: Removing leading `/' from member names
/var/log/messages
/var/log/maillog
 

ls -l
total 48
-rw-r--r-- 1 root root 40960 Apr 17 19:24 archive.tar

 

 

 

We are making archive file (tar file) name archive.tar from 2 separate folders.

 

Back to File Compression and Archiving



Copyright 2011 http://www.1a-centosserver.com All Rights Reserved

All trademarks are the property of their respective owners.

Contact Us | Terms of Use | Privacy Policy