- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Compress files problem
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
08-20-2007 05:27 PM
08-20-2007 05:27 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2007 05:32 PM - edited 10-01-2011 07:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2007 05:37 PM
08-20-2007 05:37 PM
Re: Compress files problem
tar -cvf - . | gzip > file.tgz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2007 05:45 PM
08-20-2007 05:45 PM
Re: Compress files problem
Well, not with the "tar" supplied with HP-UX.
GNU "tar" runs on HP-UX, and it offers "-z".
http://www.gnu.org/software/tar/
> [...] when I gzip it [...]
Using what command?
It's not clear what you want, but the
suggestion of:
tar -cvf - . | gzip file.tgz
is probably what you should want. And it's
essentially what (GNU) "tar -cfvz file.tgz ."
does.
This:
find . -exec /bin/tar -zcvf file.tgz {} \;
looks to me as it it will run "tar" for each
file, which has to be a lame way to do the
job.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2007 09:53 PM
08-20-2007 09:53 PM
Re: Compress files problem
Then gzip the tar file - gzip xyz.tar or
tar -cvf *.* | gzip *.tar
Hope this helps !!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2007 10:21 PM
08-20-2007 10:21 PM
Re: Compress files problem
(There are no folders on Unix. ;-)
>tar -cvf *.* in the particular path.
*.* isn't a good pattern for tar, it misses names without ".".
>Then gzip the tar file - gzip xyz.tar
Yes.
>tar -cvf *.* | gzip *.tar
You forgot the file or "-" and the pipe would need more plumbing/fiddling.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2007 09:02 PM
08-21-2007 09:02 PM
Re: Compress files problem
I use the command tar -cvf - . | gzip > file.tgz , it works fine , I would like to ask one more question , what is the function of - ( the second one ) in this command ? I tried that if not omit it , it is not work . thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2007 09:21 PM
08-21-2007 09:21 PM
Re: Compress files problem
-f takes a file name. So you have to have something there. "-" is a convention in UNIX commands to use stdout or stdin for that file.