Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2006 03:58 PM
10-05-2006 03:58 PM
What is the command syntax for untarring tar file to specified path ?
What is mega tar ? Is it tar of many tar files ? Is there any advantage of it ?
Thanks,
Shiv
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2006 04:22 PM
10-05-2006 04:22 PM
SolutionIf you used explicit paths, like 'tar -cvf file.tar /home/me' then it is difficult to restore to any place other than /home/me.
However if you used relative paths:
# cd /home
# tar -cvf file.tar ./me
Then it is easier to restore somewhere else.
# cd /newdir
# tar -xvf file.tar
This will restore ./me in the /newdir directory.
If you must restore a tar file created with explicit paths to a different directory you can make use of the 'pax' command. Do a 'man pax' for details. I can't recall the exact syntax you would need at the moment.
As for "mega tar" -- I have no idea what it means. I guess it would depend entirely on the context in which it is being used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2006 04:26 PM
10-05-2006 04:26 PM
Re: tar
say you tar the files tar -cvf /tmp/tcb/tar /tcb
then no matter from where you untar them the files will always be untared in /tcb
But if you cd to the directory
cd / and then tar the directory then when you untar them it will create tar/files...in the directory from where you run the untar command
Never heard of mega tar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2006 04:36 PM
10-05-2006 04:36 PM
Re: tar
To create a tar you can use
tar -cvf destination(test.tar) source(/home)
to untar you can use
tar -xvf destination(path of new dir) source(test.tar)
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2006 07:02 PM
10-05-2006 07:02 PM
Re: tar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2006 08:42 PM
10-05-2006 08:42 PM
Re: tar
c -> create
x -> extract
t -> type
u -> update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2006 09:08 PM
10-05-2006 09:08 PM
Re: tar
cd /tmp
tar xvf file.tar
or
tar xvf file.tar .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2006 05:04 PM
10-06-2006 05:04 PM
Re: tar
Regards,
Shiv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2006 05:34 PM
10-06-2006 05:34 PM
Re: tar
"tar" archive ("tar t"), and where you'd like
the files to end up. Knowing neither where
you're starting nor where you wish to go
makes it hard to say how you should try to
get there. Creating the archive with
absolute path names, for example, can make it
harder to control the path names of the files
when they're extracted.
The "tar" programs which come with most
commercial UNIX operating systems tend to be
rather limited. With HP-UX, an alternative,
"pax", offers a "-s" option which can be used
to transform file names when creating an
archive or extractling files from one.
("man pax".)
Similarly, GNU "tar" offers options like
--strip and --transform, which also can be
used to transform file names similarly.
http://www.gnu.org/software/tar/
http://www.gnu.org/software/tar/manual/index.html
http://www.gnu.org/software/tar/manual/html_node/transform.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2006 05:59 AM
10-07-2006 05:59 AM
Re: tar
It's been a while since I answered one of your posts so HI!.
Generally, I am lazy so I put the tar file where I want it to untar and do tar xvf filename.tar
There are options built into tar for redirecting the output but I've found they don't always work as expected.
tar tvf lets me look at the tar archive without actually untarring it.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2006 05:42 AM
10-08-2006 05:42 AM
Re: tar
Secondly, does it work with GNU's tar ?
Best Regards,
Shiv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2006 06:13 AM
10-08-2006 06:13 AM
Re: tar
> Which option allows me for untarring at different locations?
As Patrick noted, if you made your 'tar' archive with *relative* paths, then this is as simple as he showed in his example.
If you created your archive with absolute paths, you can use 'pax'. Consider the case where files in '/olddir' are to be extracted and placed into '/newdir'. The '/newdir' directory does need not exist, either:
# pax -r -p e -s '%^/olddir/%^/newdir/%' -f /dev/rmt/0m
...or:
# pax -r -p e -s '%^/%/newdir/%' -f /dev/rmt/0m
Notice that I've used the caret (^) to anchor the slach (/) to the beginning of the string specified -- that is to denote the absolute path's starting point.
As for being "at home" and not have a server available, you still have the HP documentation site, in this case the *manpages*:
http://www.docs.hp.com/en/hpuxman_pages.html
For GNU software, there is the invaluable resource here:
http://www.gnu.org/manual/manual.html
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2006 06:18 AM
10-08-2006 06:18 AM
Re: tar
Best Regards,
Shiv