- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- cat vs. dd, gzip file size
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
тАО02-26-2004 08:56 AM
тАО02-26-2004 08:56 AM
cat dbfile | gzip > dbfile.gz
Recently saw that an alternate way is to use:
dd if=dbfile | gzip > dbfile.gz
It was said that using cat can cause corruption of the file. Is "dd" a better way to do this ? What is the file size limit using "dd" ? Does gzip gzip 1.2.4 (18 Aug 93) have a file size 2GB limit ?
Finally, my last question is, when unzipping, e.g. cat dbfile.gz | gunzip > dbfile
is there a way to prompt before overwriting if
the dbfile is already there in the destination ? And similarly, to use dd going the other way (unzip) would I use:
dd if=dbfile.gz | gunzip > dbfile
Are there yet other ways to do this that are
better ? Also, will one way be faster ? And if dd is better, are there switches on dd that can be used with Veritas file system that will make it faster ?
Solved! Go to Solution.
- Tags:
- gzip
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2004 09:07 AM
тАО02-26-2004 09:07 AM
Re: cat vs. dd, gzip file size
You could do:
# gzip < /path/to/dbfile > /path/to/compressed/dbfile.gz
This will take dbfile as input and output it to dbfile.gz.
Yes, gzip 1.2.4 has a 2GB limit. Gzip 1.2.4a and greater overcomes this if I recall correctly.
If you do the reverse when you gunzip the file:
# gunzip < /path/to/compressed/dbfile.gz > /path/to/dbfile
If you do the above, it will NOT prompt you if the output file already exists.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2004 09:10 AM
тАО02-26-2004 09:10 AM
Re: cat vs. dd, gzip file size
if [ -f $filename ] then
echo "file exists, remove it?"
read aa
if [ "$aa" = "Y" ]
then
rm $filename
fi
else
# do the gzip thing
fi
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
тАО02-26-2004 09:11 AM
тАО02-26-2004 09:11 AM
Re: cat vs. dd, gzip file size
I don't know why you would want to use dd or cat unless you want to preserve the original file.
gzip dbfile
If you want to preserve the file then you would do
gzip -c dbfile > dbfile.gz
Similarly gunzip.
Look at the man page of gzip for more options.
Yes. Your gzip has 2 GB file limit. You can get a better one from the porting center.
http://hpux.cs.utah.edu/hppd/hpux/Gnu/gzip-1.3.5/
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2004 09:14 AM
тАО02-26-2004 09:14 AM
Solutiongzip < dbfile > dbfile.gz
BUT there is a downside to this in that the output and input files are on the same device, indeed the same filesystem. A better answer would be to read stdin on one device and write it on another device so that the I/O subsystem is not saturated.
e.g.
cd /u01/mydata
gzip < dbfile > /u02/mydata/dbfile.gz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2004 11:24 AM
тАО02-26-2004 11:24 AM
Re: cat vs. dd, gzip file size
cd /u01/mydata
gzip < dbfile > /u02/mydata/dbfile.gz
Does 2GB file limit still apply ? It seems from the responses that it does!
Assume using EMC symmetrix/DMX hooked up to my HP rp7410 o L2000, does this sort of consideration still apply ? The manufacturers of products like EMC will say that the hardware/software of their product handles all I/O bottlenecks auto-magically but I still have the strong instinct to do as suggested above and offload some of the I/O to another VG.
The if/then solution is clear, I of course should have thought of that...nevertheless being sometimes of small brain, I always deeply appreciate those who point out the obvious which I often miss while clearly seeing the minutuae...
Gil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2004 11:30 AM
тАО02-26-2004 11:30 AM
Re: cat vs. dd, gzip file size
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2004 02:20 PM
тАО02-26-2004 02:20 PM
Re: cat vs. dd, gzip file size
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-01-2004 03:43 AM
тАО03-01-2004 03:43 AM
Re: cat vs. dd, gzip file size
Gil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2004 08:37 AM
тАО03-05-2004 08:37 AM