- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to zip and unzip 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
тАО05-26-2007 09:15 PM
тАО05-26-2007 09:15 PM
how to zip and unzip file
how to zip and unzip file and directory in unix server.
and are i can use tar command for that
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-26-2007 10:04 PM
тАО05-26-2007 10:04 PM
Re: how to zip and unzip file
Zip is here:
http://hpux.connect.org.uk/hppd/hpux/Misc/zip-2.32/
Unzip is here:
http://hpux.connect.org.uk/hppd/hpux/Misc/unzip-5.52/
Tar itself cannot compress, but you can certainly create a tar file containing a directory and then you can compress that tar file.
If you want to create a tar-file containing 'somedir' you could do it several ways.
1) Create it with relative paths so you can extract it ANYWHERE later on
# cd /somedir
# tar -cvf ../somedir.tar .
Will create a tar file in the parent of 'somedir' called somedir.tar. You can then compress this with compress or gzip.
# compress somedir.tar
or
# gzip somedir.tar
2) If you want to create a tar file with explicit paths to somedir and then compress it you can do:
# cd /var/tmp
# tar -cvf somedir.tar /somedir
# compress somedir.tar
or
# gzip somedir.tar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-26-2007 10:28 PM
тАО05-26-2007 10:28 PM
Re: how to zip and unzip file
The "jar" tool is used exactly like "tar" but the .jar files it creates are 100% compatible with .zip files. If you use "jar" to package a set of files, it will automatically generate one extra file named "Manifest" to the package; it's related to jar's use with Java, just ignore it.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-26-2007 11:18 PM
тАО05-26-2007 11:18 PM
Re: how to zip and unzip file
You can also use the -C option:
$ tar -cvf somedir.tar -C /somedir .
And you could also use pax(1) to rename any existing path in your tar archive, when extracting.
>You can then compress this with compress or gzip.
You can also do this in one step:
$ tar -cvf - . | gzip > ../somedir.tar.gz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-26-2007 11:22 PM
тАО05-26-2007 11:22 PM
Re: how to zip and unzip file
to files (and archives) smaller than 2GB.
Zip 3 and UnZip 6 should remove that
limitation, but they have not yet been
released. For the latest pre-release
("BETA") kits, see:
ftp://ftp.info-zip.org/pub/infozip/beta/
The size limitations for "tar" depend on
whose "tar" you use.
If you use "tar" and want compression, most
people do both in a pipeline:
tar cf - whatever | gzip -c > whatever.tgz
gzip -cd whatever.tgz | tar xfo -
Details depend on which options you want.
More details depend on why you want to do any
of this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-26-2007 11:27 PM
тАО05-26-2007 11:27 PM
Re: how to zip and unzip file
i want to zip an unzip to any file and directory
not only .tar
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-27-2007 05:18 AM
тАО05-27-2007 05:18 AM
Re: how to zip and unzip file
> directory
> not only .tar
Huh? When used properly, either [Un]Zip or
"tar" can do almost anything to any file or
directory. Can you explain more clearly what
you want to do? An example might help.
Or go back and look at those "tar"
suggestions more carefully.
> # tar -cvf ../somedir.tar .
There's a dot (current directory) at the end
of that line. "man tar"?
(I'm starting to get that feeling again that
this is all hopeless.)