ÅÝܽ¶ÌÊÓƵ

print friendly version

Questions and answers

237
How do I make a 'tar' archive of a series of files?


The commands described below need to be entered while logged in to the Unix server.   Normally you'll see a prompt ending with $ when the command interpreter (or shell) is ready for another command.

Basically you type

tar   cvf   tarfile   file1   file2   file3   file4 etc
  • c in cvf means 'Create new tar volume';
  • v in cvf means 'be Verbose'; that is 'tell me what's happening';
  • f in cvf means 'name of tar volume file follows';
  • tarfile is the name of the tar volume file the files are to go in;
  • file1 through file4 etc are the files (you can specify a directory if you wish; the entire directory would be tar'd to the tar volume).

For example:

tar cvf  project.tar  synopsis.doc  mainbody.doc  conclusion.doc


(the files synopsis.doc,  mainbody.doc and  conclusion.doc are copied to a new tar file  called project.tar)

For more information, enter the command:

info  tar

 

Help us to improve this answer

Please suggest an improvement
(login needed, link opens in new window)

Your views are welcome and will help other readers of this page.

Categories

This is question number 237, which appears in the following categories:

Created by Andy Clews on 27 July 2001 and last updated by Andy Clews on 4 August 2015