- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to create compressed 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
тАО10-26-2006 12:09 AM
тАО10-26-2006 12:09 AM
How to create compressed file
I want to create compressed file out of so many files. Can any one suggest how crate a compressed file out of more then 2000 no of files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2006 12:17 AM
тАО10-26-2006 12:17 AM
Re: How to create compressed file
You can first make a tar backup file (like winzip).
# tar cfv /a/big/dir/myarch.tar dir_contain_files_and_subdirs
# gzip /a/big/dir/myarch.tar
If you want to create +2000 zip files,
# cd dir_with_files
# for file in *
# do
# gzip $file
# done
Yang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2006 12:19 AM
тАО10-26-2006 12:19 AM
Re: How to create compressed file
# find /your/dir | gtar -T - -czf /tmp/archive.tgz
Or create an index in /tmp/index
# gtar -T /tmp/index -czf /tmp/archive.tgz
If it's mostly ASCII files (text), use bzip for (much) better compression. This example doesn't require GNU tar:
# cat index | xargs tar cf - | bzip2 -9 >/tmp/archive.tbz
So many other solutions exist
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2006 12:19 AM
тАО10-26-2006 12:19 AM
Re: How to create compressed file
please allocate points to answers.
Please see:
http://forums1.itrc.hp.com/service/forums/helptips.do?#22
Your profile shows 0 points to 13 answers !
tar cvf /dest/files.tar ./*
then
gzip /dest/files.tar
or
compress /dest/files.tar
For more info:
"man tar"
"man compress"
If tar blows out due to number of files back up the directory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2006 12:38 AM
тАО10-26-2006 12:38 AM
Re: How to create compressed file
# tar cf file.tar file ....
# gzip file.tar
Will easily hit the 2 Gb limit.
Use streaming mode instead
# tar cf - file ... | gzip -9 >file.tar.gz
Extra remark, even if GNU tar supports bzip2 as a command line option, be warned that it is not a builtin, but tar will use the external bzip2 command. gzip *is* builtin.
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2006 01:02 AM
тАО10-26-2006 01:02 AM
Re: How to create compressed file
For more details about each of those utilities particular features, check their respective man pages.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2006 01:07 AM
тАО10-26-2006 01:07 AM
Re: How to create compressed file
You can find zip here:
http://hpux.connect.org.uk/hppd/hpux/Misc/zip-2.32/
If you will need to unzip on the HP-UX machine you will also need to install unzip:
http://hpux.connect.org.uk/hppd/hpux/Misc/unzip-5.52/
Once zip is installed you can do a:
# zip /dir/myfiles.zip /dir/file1 /dir/file2 /dir/file3
and just continue listing files.
For full usage instructions:
# zip -?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2006 04:44 PM
тАО10-26-2006 04:44 PM
Re: How to create compressed file
A directory and all its files and sub directires.
cd /directory
find . -print |cpio -o |gzip >list.gz
all files with a .sh extension
find / -name "*.sh" |cpio -o |gzip > /tmp/shells.gz
To extract
mkdir /recover_dir
cd /recover_dir
gunzip /directory/list.gz
cpio -idmu < /directory/list
gunzip /directory/shells.gz
cpio -idmu < /directory
If you really mean compress use compress instead of gzip.
Rory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2006 07:19 PM
тАО10-26-2006 07:19 PM