- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how untar the file in different directory
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
Discussions
Discussions
Discussions
Forums
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
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
тАО08-13-2010 06:00 AM
тАО08-13-2010 06:00 AM
how untar the file in different directory
Example
$/tmp
$ls -l
$test.tar test
$tar -xvf test.tar -C /opt
this is possible or not
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-13-2010 06:25 AM
тАО08-13-2010 06:25 AM
Re: how untar the file in different directory
If you have a 'tar' archive that was made with absolute paths, use 'pax' to extract it to a different directory:
# pax -r -s '|/tmp/|/opt/|' -f test.tar
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-13-2010 09:37 AM
тАО08-13-2010 09:37 AM
Re: how untar the file in different directory
You're right?
What's in "test.tar"?
tar tfv test.tar
> [...] use 'pax' [...]
Or GNU "tar".
Or, you could look at any of the dozens of
similar threads in this Forum, where this
question has been answered before.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-14-2010 07:34 AM
тАО08-14-2010 07:34 AM
Re: how untar the file in different directory
The -C option is only valid when writing to an archive.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-14-2010 07:46 AM
тАО08-14-2010 07:46 AM
Re: how untar the file in different directory
If you have taken the tar backup without the first "/" you can extract it to any other directory,
- What is the output of # tar -tvf test.tar
For Example: (Taking a backup of /etc )
# cd /
# tar -cvf etc_backup.tar etc
Extracting above /etc backup to /mydir/ :
# cd /mydir/
# tar -xvf /etc_backup.tar .
# it will create the etc directory under the current directory and extract all file & directgoirs of etc backup. So the path will be /mydir/etc/ .....
Hope this helps,
Raj.