Because, it's a consistency thing. In general you can do:
a | grep b
so:
ls -l | grep donkey
make all | grep error
...
whatever
cat /var/log/system/whatever | grep pattern
it's just using the same pattern as is used every other time, that's all.
by Anonymous (not verified) on 4/13/09 at 10:27 pm |reply
There is a reason...
It was a standard practice in the past. Now, it is just as acceptable for small operations, but against larger files, it takes much longer due to the processing of the ENTIRE file once by cat, then reprocessing the STDIN from the pipe to grep.
If I am searching short phrases on the command line, I still cat | grep because it is easier to replace the end string than backing up past the filename. There is more than one way to do something in Unix/Linux, just understand the implications of each and use it wisely. Don't get wrapped around other peoples command line etiquite, sometimes there is a reason for their madness.
by qxy (not verified) on 5/26/09 at 8:21 pm |reply
Missing the "." (point)
The idea is not to "find" something in the file, rather to omit what you don't want. In this example the idea is to see everything that is 'not' a blank line.
by Blake (not verified) on 4/2/09 at 5:55 pm |reply
This is good stuff...
I have used the "grep ." command before and coincidentally, it was to eliminate some extraneous blank lines from a file that was creating issues with a poorly written file parser; the parser was choking on non-printable characters. I was using vi to check for those non-printables, but using cat is much simpler. Thanks...
by Mausul (not verified) on 4/6/09 at 7:54 am |reply
by Anonymous (not verified) on 6/24/09 at 8:58 pm |reply
ugg boots
UGG Boots is one of the most popular boots in the fashion realm, and it also the must-have item in the cold winter to keep your foot warm, have a pair of sheepskin UGG Boots as the gift also the great point, so, why you still hesitate, follow me!
by ugg boots (not verified) on 10/13/09 at 4:34 am |reply
replica bags
Your comments on this question are pertinent replica bags .And people always do things like and they don't know what they replica handbags are doing at the same time .It is a really common fault .
by replica handbags (not verified) on 10/24/09 at 2:16 am |reply
Oh! What a cool points and
Oh! What a cool points and the cold weather, the winter is coming, I’d like to share the UGG Boots tips to keep your feet warm.. there’s few series UGGS for you to see the winter out, such as classic tall ugg boots, classic short ugg boots,claasic cardy ugg boots and so on, the cute boots not only show you the warm, but also the fashion style. Well, seems too much words, see you next time~
by ugg boots (not verified) on 10/27/09 at 9:29 pm |reply
ugg boots
Good day! Thx for your great post and Im thinking about how to introduce my ugg boots to you cos Im not sure if u like this. Many people who live in the cold area like the ugg boots, especially the north-europe. Our uggshare.co.uk supply the cheapest classic cardy ugg boots, class tall ugg boots, classic short ugg boots and other series of uggs, hope my words didn’t trouble u, cy!
by ugg boots (not verified) on 10/27/09 at 10:46 pm |reply
Sidekick: The Good News & the Bad News Either way you look at it Microsoft Data Center management did not follow standards or best practices in this failure. In which case it makes me wonder more about the outsourcing of corporate data much less personal data.
- mburton325
Surviving Windows is easier than you think… MKS offers the power of an integrated all-in-one environment and provides you with the Power of UNIX on Windows Learn More
Brought to you by:
Free books
We have 5 copies of these two new books to give to some lucky readers. The deadline for entries is November 30, 2009.
AISO founders envisioned a Web hosting company that was environmentally friendly. While the company employed energy-efficient innovations like solar panels, its infrastructure produced unacceptable power and cooling requirements. Find out how AISO leveraged AMD technology to overcome their challenge in this case study white paper.
In this whitepaper, Scalar explores the opportunity to change the landscape with respect to mission critical databases
built around Oracle. Leveraging technologies such as Linux, high-end commodity processing power and Oracle RAC
technology to architect, design, build and maintain database infrastructure that delivers maximum availability, reliability
and performance at a fraction of traditional cost.
On a typical day, weather.com, the Web site for The Weather Channel in Atlanta, serves up between 15 million and 20 million page views. But in September 2004, when back-to-back hurricanes ransacked Florida, the peak traffic on one day more than tripled: over 70 million page views by more than 7 million unique visitors. Read the full success story now.
pipe nightmares
So many people typecat file | grep Whatever
and I never really got it - why do all that extra typing when you could just say
grep Whatever file
???
and inefficient
If you do this in a shell script, you'll be repeatedly starting an extra process for no reason at all.habit
Old habits die hard.re: Pipe nightmare
Because, it's a consistency thing. In general you can do:a | grep b
so:
ls -l | grep donkey
make all | grep error
...
whatever
cat /var/log/system/whatever | grep pattern
it's just using the same pattern as is used every other time, that's all.
There is a reason...
It was a standard practice in the past. Now, it is just as acceptable for small operations, but against larger files, it takes much longer due to the processing of the ENTIRE file once by cat, then reprocessing the STDIN from the pipe to grep.If I am searching short phrases on the command line, I still cat | grep because it is easier to replace the end string than backing up past the filename. There is more than one way to do something in Unix/Linux, just understand the implications of each and use it wisely. Don't get wrapped around other peoples command line etiquite, sometimes there is a reason for their madness.
Unix Tricks
It just goes to show you that in Unix, there is more than one way to skin a "cat".When you start dog
When you start dog training, you need know how to train a puppy can use dog behavior training and dog training tips.Missing the "." (point)
The idea is not to "find" something in the file, rather to omit what you don't want. In this example the idea is to see everything that is 'not' a blank line.This is good stuff...
I have used the "grep ." command before and coincidentally, it was to eliminate some extraneous blank lines from a file that was creating issues with a poorly written file parser; the parser was choking on non-printable characters. I was using vi to check for those non-printables, but using cat is much simpler. Thanks...jobs for 14 year olds jobs
jobs for 14 year oldsjobs for 14 year olds
jobs for 14 year olds
jobs for 14 year olds
jobs for 14 year olds
jobs for 14 year olds
jobs for 14 year olds
jobs for 14 year olds
jobs for 14 year olds
Saraideas's Blog
Sara ideas
saraideas
saraideas
saraideas
saraideas
saraideas
saraideas
saraideas
Sara's Blog
sara's Site
Saraideas
saraideas
ugg boots
UGG Boots is one of the most popular boots in the fashion realm, and it also the must-have item in the cold winter to keep your foot warm, have a pair of sheepskin UGG Boots as the gift also the great point, so, why you still hesitate, follow me!replica bags
Your comments on this question are pertinent replica bags .And people always do things like and they don't know what they replica handbags are doing at the same time .It is a really common fault .Oh! What a cool points and
Oh! What a cool points and the cold weather, the winter is coming, I’d like to share the UGG Boots tips to keep your feet warm.. there’s few series UGGS for you to see the winter out, such as classic tall ugg boots, classic short ugg boots, claasic cardy ugg boots and so on, the cute boots not only show you the warm, but also the fashion style. Well, seems too much words, see you next time~ugg boots
Good day! Thx for your great post and Im thinking about how to introduce my ugg boots to you cos Im not sure if u like this. Many people who live in the cold area like the ugg boots, especially the north-europe. Our uggshare.co.uk supply the cheapest classic cardy ugg boots, class tall ugg boots, classic short ugg boots and other series of uggs, hope my words didn’t trouble u, cy!ugg boots
Hey, WHATare u interested in fashion ugg boots? The winter is coming soon, I think you need a pair of classic cardy ugg boots to keep your feet warm, or what do you think about classic tall ugg boots and classic short ugg boots? I like these three series ugg boots so much, how about you?