HPE GreenLake Administration
Operating System - HP-UX
1834163
Members
2489
Online
110064
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
05-08-2003 05:49 PM
05-08-2003 05:49 PM
How to extract tar file to
assign directory?
for ex: tar -xvf test.tar ??
assign directory?
for ex: tar -xvf test.tar ??
Hero
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2003 05:58 PM
05-08-2003 05:58 PM
Solution
You cannot extract tar to just any directory. If it has been created (the tar backup) with absolute path names it cannot be done.
If the backup was created as ./dir/file (example) then it can be extracted to any filesystem, but the directory hierarchy will also get created.
If you not sure run
# tar tvf test.tar
If the backup was created as ./dir/file (example) then it can be extracted to any filesystem, but the directory hierarchy will also get created.
If you not sure run
# tar tvf test.tar
Anyone for a Mutiny ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2003 06:01 PM
05-08-2003 06:01 PM
Re: tar
1) if you backup not using fullpath i.e
cd /home/malay
tar cvf malay.tar *
then you extract :
cd /tmp/malay
tar xvf malay.tar
all the file will be extracted to /tmp/malay
2) if backup using fullpath i.e
tar cvf malay.tar /home/malay
then on recover if you do i.e
cd /tmp/malay
tar xvf malay tar
you file will be restored in /home/malay instead of /tmp/malay
hope this help
regards
mB
cd /home/malay
tar cvf malay.tar *
then you extract :
cd /tmp/malay
tar xvf malay.tar
all the file will be extracted to /tmp/malay
2) if backup using fullpath i.e
tar cvf malay.tar /home/malay
then on recover if you do i.e
cd /tmp/malay
tar xvf malay tar
you file will be restored in /home/malay instead of /tmp/malay
hope this help
regards
mB
There are three person in my team-Me ,myself and I.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2003 09:18 PM
05-08-2003 09:18 PM
Re: tar
If the archive was created using the full paths, you could still extract the archive to an alternate location.
# cp /sbin/tar /newpath
# cp tarfile.tar /newpath
# cd /newpath
# chroot ./ tar xvf tarfile.tar
You can then remove /newpath/tar and tarfile.tar
The files will be extracted relative to the new path. Instead of /mypath/myfile being extracted to the orignal location, it would now be /newpath/mypath/myfile
The short version to achieve the same results as above... use pax.
pax -r -p e -s '%^/%/newpath/%' -f tarfile.tar
-denver
# cp /sbin/tar /newpath
# cp tarfile.tar /newpath
# cd /newpath
# chroot ./ tar xvf tarfile.tar
You can then remove /newpath/tar and tarfile.tar
The files will be extracted relative to the new path. Instead of /mypath/myfile being extracted to the orignal location, it would now be /newpath/mypath/myfile
The short version to achieve the same results as above... use pax.
pax -r -p e -s '%^/%/newpath/%' -f tarfile.tar
-denver
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP