[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Tar

Posted on 1997-12-15
1
Medium Priority
?
506 Views
Last Modified: 2010-10-18
When I tar I use the command "tar cvf backup.tar /home/name/dir/ " When I untar I always get the /home/name/dir file structure.  How do I tar a directory and untar into a new file structure without inheriting the previous strucutre.
For example, say I wanted to tar a directory with many files in my home directory, "/home/name/dir" and want to unpack it on another Unix box in "export/home/newdir" How can I unpack the dir files in newdir directory without inheriting the previous file structure beyond newdir.
Plese be specific as possible.  Thanks in advance.
                        dkurry
0
Comment
Question by:dkurry
[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
1 Comment
 

Accepted Solution

by:
Mika_Saari earned 200 total points
ID: 2008353
Hi !

      With dir subdirectory
      Tar:
      1. cd /home/name
       2. tar cvf /tmp/backup.tar dir
      Now the directory is backupped without the
        /home/name prefix

      Untar:
        1. cd /export/home/newdir
       2. tar xvf /tmp/backup.tar
        then the structure will be
      /export/home/newdir/dir

      --------------------------
      If you do not want the dir
      Tar:
      1. cd /home/name/dir
      2. tar cvf /tmp/backup.tar *

      Untar:
      1. cd /export/home
      2. mkdir newdir
      3. cd newdir
      4. tar xvf /tmp/backup.tar            
      

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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.:
Suggested Courses

649 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