Solved

A question on tar using -C

Posted on 2004-08-13
3
178 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

760 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

24 Experts available now in Live!

Get 1:1 Help Now