Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

A question on tar using -C

Posted on 2004-08-13
3
181 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 Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
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 find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

856 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