Searching for a string in a gz compressed file

Tags:

Gzip is a compression technology available on most unix/linux systems.  Once in a while you might see a file such as filename.gz or filename.tar.gz and you may need to search through that file… I know some popular web server programs, such as apache, compress old log files to save space…

If you need to search through a .gz file, just use the zcat command (similar to cat):

zcat file.gz

You could even zcat the file then grep it’s contents or you could head or tail the file to see the start or end, respectively.  Pretty cool, now you don’t have to do a gunzip or tar xvfz.

zcat file.gz | grep ’some string’

or

zcat file.gz | head ’some string’

One note would be that greping the contents of a zcat will take some time, where using head or tail seems to execute a little faster. 

Comments

so you have to take it every day.

The Age Of Anxiety Is Over For You

Anxiety is a condition that seriously impacts the lives of countless sufferers the world over. That is not to say that it cannot be defeated, when the proper techniques are employed. Use the ideas and tips in the article that follows, and you will be well prepared to confront the condition head on,Mulberry tasker, and achieve impressive results.

Taking alcohol out of the picture. Alcohol is a depressant and can severely impact your approach to issues. When you drink, your mind is clouded and you can easily begin to obsess over issues. Minimize your drinking and the amounts you imbibe when you do. Keeping a clear head makes for clear thoughts.

You need to relax. For someone who struggles with anxiety, this is easier said than done. However,Mulberry Skulder Tasker, learning to relax is essential in managing anxiety. Make the effort to give yourself time to relax every day. Whether you enjoy a hot bubble bath and scented candles or a hike in a secluded forest, time spent focusing on yourself can allow you to regroup and re-center.

If you have been prescribed medication for anxiety, be sure that you take it at the same time every day. You can put your bottle by your toothbrush in the cabinet, or just wherever you will notice it. Remember that some medications take a while to work, so you have to take it every day.

If you're having problems at work or school,Mulberry Sale, then talk to your supervisor or teacher. Let them know what's going on and that you're doing the best you can, even though anxiety can be affecting your productivity. The more you open up to people the less anxious you feel in general, especially at work or school.

Sometimes, social anxiety can force you into inertia. You don't want to do something wrong and be blacklisted from the group that you'd like to be a part of. If you feel anxious about joining a group or approaching some new people, do your research. Observe them before joining them. Read up on the club. Be as prepared as you can and then go for it!

Know your limits if you suffer from anxiety. If you have had a stressful day, cancel anything that may have been on the schedule for the rest of the night. Pop a frozen pizza in the oven for dinner and allow yourself to recuperate from the stress, otherwise you may be inviting anxiety to take over.

Learning how to fight anxiety is just the beginning of the battle. Now it is up to you to apply all that you have learned here today in order to truly fend off your anxiety once and for all. It is possible to live anxiety free, it's just a matter of how much you apply yourself with what you know.

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
4 + 8 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.