- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: help with tar please
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
09-24-2001 11:27 AM
09-24-2001 11:27 AM
I have a directory caled /xx/xxx/prod. I would like to tar everything in teh prod directory to a directory called /tmp. How would I do this with the tar -cvf command so that my tar file is now located in /tmp directory. Any help will be greatly appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2001 11:29 AM
09-24-2001 11:29 AM
Solutioncd /xx/xxx
tar cvf /tmp/prod.tar prod
this will create a tar file called prod.tar in /tmp with the contents of ther prod directory in /xx/xxx
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2001 11:30 AM
09-24-2001 11:30 AM
Re: help with tar please
Try:
tar -cvf /tmp/my.tar /xx/xxx/prod
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2001 11:30 AM
09-24-2001 11:30 AM
Re: help with tar please
# tar -cvf /tmp/prod.tar ./prod
or
# cd /xxx/xxx/prod
# tar -cvf /tmp/prod.tar .
(notice that there is a space between /tmp/prod.tar and the dot)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2001 11:37 AM
09-24-2001 11:37 AM
Re: help with tar please
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2001 11:39 AM
09-24-2001 11:39 AM
Re: help with tar please
cd /prod
tar -xvf /tmp/my.tar
If you used my example above it would put the full path on each file which probably isn't what you want. Better to do it like the other replies and 'cd' to the directory first.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2001 11:43 AM
09-24-2001 11:43 AM
Re: help with tar please
# cd /xxx/xxx
# tar -cvf /tmp/prod.tar ./prod
Then untar into /prod directory by:
# cd /
# tar -xvf /tmp/prod.tar
If you created the tar file with the following:
#cd /xxx/xxx/prod
tar -cvf /tmp/prod.tar .
Then untar into /prod directory by:
# cd /prod
# tar -xvf /tmp/prod.tar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2001 02:36 PM
09-24-2001 02:36 PM
Re: help with tar please
cd /xx/xxx/prod
tar cf - . |(cd /tmp; tar xpf -)
This command will tar up the files, and in the sub-shell (inside parens) will move to the new directory and untar the files.
If this is done as "root" it will save all the permission and date/timestamp.
art