Solved

A question on tar using -C

Posted on 2004-08-13
3
182 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
[X]
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
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

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…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

697 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