LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 11-07-2003, 08:52 AM   #1
dvong3
Member
 
Registered: Sep 2002
Posts: 168

Rep: Reputation: 30
Tar into different path


I achieve (tar cvf) my /export/home but I like to extract the file into a different directory. I try several commands but it doesn't work, I like to tar xvf into /test directory. Am I missing some commands?

dvong

# tar cvf dannyhome.tar /export/home/danny
a /export/home/danny/ 0K
a /export/home/danny/.dt/ 0K
a /export/home/danny/.dt/sessions/ 0K
a /export/home/danny/.dt/sessions/lastsession 1K

# tar xvf dannyhome.tar /test
 
Old 11-07-2003, 09:08 AM   #2
FirebirdV0273
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 84

Rep: Reputation: 15
go to the /test directory and use the command from there.

#cd /test
#tar xvf /export/home/danny/dannyhome.tar
 
Old 11-07-2003, 09:12 AM   #3
dvong3
Member
 
Registered: Sep 2002
Posts: 168

Original Poster
Rep: Reputation: 30
Nope doesn't work ....

# cd /test
# ls
dannyhome.tar lost+found
# ls -al
total 308164
drwxr-xr-x 3 root root 512 Nov 7 05:26 .
drwxr-xr-x 32 root root 1024 Nov 7 05:52 ..
-rw-r--r-- 1 root other 157677056 Nov 7 06:21 dannyhome.tar
drwx------ 2 root root 8192 Nov 7 05:23 lost+found
# tar xvf /export/home/danny/dannyhome.tar
tar: /export/home/danny/dannyhome.tar: No such file or directory
 
Old 11-07-2003, 09:28 AM   #4
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Try using relative paths instead of absolute ones. Do something like:
cd /export/home/danny
tar cvf dannyhome.tar ./*
cd /test
tar xvf /export/home/danny/dannyhome.tar
 
Old 11-11-2003, 03:38 AM   #5
dvong3
Member
 
Registered: Sep 2002
Posts: 168

Original Poster
Rep: Reputation: 30
It works...thanks.

dvong
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 02:48 AM
tar tar cvf - . | (cd /root/; tar xvf -) ewt3y Linux - General 10 02-19-2014 10:55 AM
TAR Archive file - need relative path cmd0a0 Linux - Software 2 10-19-2005 02:57 PM
tar with directory path scatterbrain Linux - General 2 03-15-2004 11:05 PM
Diferance between rpm, tar, tar.gz, scr.tar, etc mobassir Linux - General 12 08-21-2003 06:30 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 11:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration