Solved

A question on tar using -C

Posted on 2004-08-13
3
179 Views
Last Modified: 2010-04-20
What does this do "tar c -C /usr include -C /etc ."
I am not able to execute that successfully.
It will tar files from /usr/include and /etc and put it in the current directory?

0
Comment
Question by:gopikrish
3 Comments
 
LVL 20

Accepted Solution

by:
Gns earned 20 total points
ID: 11791296
It'll create a tar archive at the default tape device (see below) by first changing directory to /usr, getting all files from includ and downward, then change directory to /etc and getting everything from the current directory ... (which happen to be /etc).

Your error is likely that the default device /dev/rmt0 is non-existant on your system;-).
Now, this default device is actually decided during compilation (at least for GNU tar), so ... since most systems _don't_ have an rmt0 device, many distrios have this set to something else... You can see what by looking at the defenition of ARCHIVE in the output from
tar --help
... might default to "-f- -b20" whcih basically would just spew the complete archive onto stanrad output (ie the screen).
Remedy would be to use the -f flag to specify a file/location for the archive.

-- Glenn
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Fine Tune your automatic Updates for Ubuntu / Debian
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now