- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- create a tar file
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
тАО09-14-2005 05:15 AM
тАО09-14-2005 05:15 AM
create a tar file
for example
my step now is
cd ~/
tar -cvf test.tar test/*
tar -tvf show
~/test/1
~/test/2
how can I change it to
/tmp/test/1
/tmp/test/2
I know that I can move files to /tmp, and then create the patch there...but is there a better way?
thank you
- Tags:
- tar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2005 05:21 AM
тАО09-14-2005 05:21 AM
Re: create a tar file
tar -cvf /tmp/test.tar test/*
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2005 05:23 AM
тАО09-14-2005 05:23 AM
Re: create a tar file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2005 05:24 AM
тАО09-14-2005 05:24 AM
Re: create a tar file
cd ~/
tar cf test.tar test/*
is what you want to do.
To restore to tmp, you would then
cd /tmp
tar xf ~/test.tar
gnu tar might be able to do what you want.
HTH
-- Rod Hills
- Tags:
- gtar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2005 05:28 AM
тАО09-14-2005 05:28 AM
Re: create a tar file
Generally speaking making 'tar' archives with relative paths provides the most flexability.
That said, however, I'd look at 'pax' ('tar's cousin). 'pax' gives you the opportunity to do regular expresssion substitutions o the archive member names.
See the man pages for 'pax' and the '-s' option therein.
Regards!
...JRF...
- Tags:
- pax
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2005 05:30 AM
тАО09-14-2005 05:30 AM
Re: create a tar file
in case if people forget to cd to /tmp, I still want tar to handle it, that is why.
look the only solution is
cp ~/tests/* /tmp/tests.
tar -cv test.tar /tmp/tests/*
hmm.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2005 05:31 AM
тАО09-14-2005 05:31 AM
Re: create a tar file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2005 05:32 AM
тАО09-14-2005 05:32 AM
Re: create a tar file
DONT make absolute tar files, you get get in a whole heap of problems doing this...
try
# cd /tmp; tar xf test.tar
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2005 05:34 AM
тАО09-14-2005 05:34 AM
Re: create a tar file
That is what this forum is about....
Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2005 05:37 AM
тАО09-14-2005 05:37 AM
Re: create a tar file
'pax' exists on AIX too! It's not just HP-UX.
Regards!
p.s. Thanks, Rodney :-)
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2005 07:49 AM
тАО09-14-2005 07:49 AM
Re: create a tar file
Other than copying ~/test to /tmp/test i also see one more solution that is to have small script which will cd to /tmp and then extract the tar file there.
"tar cvf test.tar ./test/*"
then provide that tar file alongwith thescript as :
#!/usr/bin/ksh
cd /tmp
tar xvf test.tar
cd
That's all.
regards,