How to create an archive using tar in Linux
Guide Overview
This guide explains how to create an archive of files using the Linux/Unix tar command.
Requirements
Shell Access or Console
Instructions
- Connect to a shell or open a terminal/console on your Linux/Unix machine.
- To create an archive of a directory and its contents you would type the following and press enter:
- tar -cvf name.tar /path/to/directory
Substitute the name.tar with the name of the tar file you would like to create and substitute the directory name for the full path to the directory you would like to archive.
- tar -cvf name.tar /path/to/directory
- To create an archive of certfain files you would type the following and press enter:
- tar -cvf name.tar /path/to/file1 /path/to/file2 /path/to/file3
Substitute the name.tar with the name of the tar file you would like to create and substitute the the various files for the full path to the files you would like to archive. Each file you would like included in the archive should be seperated by a space.
- tar -cvf name.tar /path/to/file1 /path/to/file2 /path/to/file3


Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Back to top







