- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- gzip command
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-11-2003 09:34 AM
08-11-2003 09:34 AM
Can someone Please help me with the commands.
My unix skills are limited. Please forgive.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2003 09:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2003 09:43 AM
08-11-2003 09:43 AM
Re: gzip command
# gzip -rv /logdir
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2003 09:53 AM
08-11-2003 09:53 AM
Re: gzip command
You were on the money!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2003 09:54 AM
08-11-2003 09:54 AM
Re: gzip command
You can use the following.
ls -al |grep -v ^d |awk '{print $9}'|while read a ;do gzip $a;echo "$a zipped" ;done
(before executing just make sure ls -al |grep ^d is displaying all the file names which you need to be zipped other than sub directory names )
explanation.
ls -al |grep -v ^d --> will extact all the files other than directories(I have taken in to consideration that you may have sub dir in side that dir)
awk '{print $9}' -->will extract the ninth field from the ls -al out put which will be the file names.
then the file names are parsed into a while ,do ,done loop.
this will zip all the files other than directories .
if u have some specific file patter then
for example *.log
ls *.log |while read a ;do gzip $a;echo "$a zipped" ;done
will do .
regds,
baiju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2003 09:59 AM
08-12-2003 09:59 AM
Re: gzip command
Asume that your log files are in:
/mnt/log/archive
gzip -r /mnt/log/archive
Will gzip all the files.
This works like the compressdir command
Assume that you have directory tree that you want to
compress up and leave in place:
|-bin----------|-runhpterm2---
|-hithere-----
|-test2-------
|
| |-OO081701.DBF-
| |-OO081801.DBF-
User-----| |-OO081901.DBF-
| |-OO082001.DBF-
| |-OO082101.DBF-
|-data---------|-OO082201.DBF-
|-OO082301.DBF-
|-OO082401.DBF-
|-OO100201.DBF-
gzip -r /home/User
will do files in all the directories.
Ror
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2003 12:45 PM
08-12-2003 12:45 PM
Re: gzip command
Not related to your problem as that has been amply answered above. But when transporting the files (I assume you will e-mail these files somewhere/to someone) remember if using FTP to use BINARY transfer, otherwise those files will end up corrupted!!
Tim