Monday, May 23, 2011

Linux / Unix tar command

tar command use for Create tape archives and add or extract files.

tar Command Options
-c: Create a tar file
-t: List the contents of a tar file
-x: Extract or restore a tar file
-v: Verbose (display the actions tar is taking)

Create a new tar file:
% tar ctvf outputfile.tar inputfile(s)

-f: filename

Examples for backup FoxBase+:
% tar ctvf foxbase.tar /usr/lib/foxplus /usr/bin/fox*

To extract files:
% tar xvf filename.tar

To extract files to different folder:
% tar -xzvf <filelname> /home/bob

Write tar file on a backup tape:
% tar cvf filename.tar /dev/rct0

No comments:

Post a Comment