- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: decompress to another 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
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-23-2007 07:06 AM
тАО08-23-2007 07:06 AM
Escenario:
1) I compress a directory into a tar file:
$ tar -zcvf MyTar.tar.gz /oback/*
2) I want to decompress the files to another directory. This is I want that my compressed (tar.gz) files be created into a different directory from the one that were taken. Something like...
$ tar -zxvf MyTar.tar.gz "to directory /NewDir/
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-23-2007 07:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-23-2007 07:34 AM
тАО08-23-2007 07:34 AM
Re: decompress to another directory
-C
man tar
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
тАО08-23-2007 10:00 AM
тАО08-23-2007 10:00 AM
Re: decompress to another directory
Some of the older tar versions, and some of the non-GNU tar's, wont strip the absolute-path's leading /..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-23-2007 10:11 AM
тАО08-23-2007 10:11 AM
Re: decompress to another directory
The original path of the files is:
/orafiles/pruebas/01/*
But I want to decompress them to:
/oback/xyz/*
The "-C" option, decompress them to:
/oback/xyz/orafiles/pruebas/01/*
I wanti to remove the original path "/orafiles/pruebas/01/" and decompres (create) the files DIRECTLY in "/oback/xyz"
Is that possible?
If not, I need to decompress (with all the original path and then move them to the new path, but this is a task consuming time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-23-2007 10:49 AM
тАО08-23-2007 10:49 AM
Re: decompress to another directory
Asumming there are multiple things in 'oback', you can do only a partial restore (it'll take about the same time though).
Once it's restored though, the 'mv' command to put it in the right place should be near-instantaneous (same filesystem move only updates inode tree, doesn't actually move data).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-23-2007 08:58 PM
тАО08-23-2007 08:58 PM
Re: decompress to another directory
Never use an absolute path, linux tar warns of this. The problem is that when you unpack, you will be forced to unpack to the same absolute path. While creating a tar file you should change to the appropriate directory and tar from there.
To remove directory name after tar, mv command would be better.
cd oback/xyz
mv orafiles/prubase/01/*.* .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-24-2007 04:20 AM
тАО08-24-2007 04:20 AM
Re: decompress to another directory
gunzip < MyTar.tar.gz | pax -rv -s ^/orafiles/pruebas/01/^/oback/xyz/^
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-24-2007 04:25 AM
тАО08-24-2007 04:25 AM
Re: decompress to another directory
gunzip < MyTar.tar.gz | pax -rv -s ^orafiles/pruebas/01/^/oback/xyz/^
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-24-2007 04:35 AM
тАО08-24-2007 04:35 AM
Re: decompress to another directory
There is a very time consuming task to move the decompressed files if the movement is from one filesystem inside th local disk to another filesystem inside the NAS storage. The sum of all files is more than 50GB.
To change my default directory to the directory where are all the files to compress is a good (an already tested) opcion for me. But changing the pattern is also a good and more flexible solution.
Thanks to all for your knowledge and for your time.