[kwlug-disc] Grep on Ubuntu 11.04 (aka The Natty Narwhal)

unsolicited unsolicited at swiz.ca
Sat May 7 12:23:08 EDT 2011


John Johnson wrote, On 05/07/2011 1:32 AM:
> On 2011-05-07 01:16, Darcy Casselman wrote:
>> ls -a | grep --color=none -h [A-Z]
> 
> No luck.
> Not sure what -h does (& lazy/tired to Google)
> All filenames are output irrespective of the regex.

I've lost track, but for the purposes of this thread, I'll assume all 
use is happening on your linux box, not your windows.

IIRC, grep only returns matches. Unless you take specific action to 
tell it to do differently?

To Darcy's point, you may be getting schmucked by internationalization.

You could also be getting aliased, and running options differently 
than you expect. Type 'alias' at the command line and you might see 
grep aliased.

Myself, my grep alias is 'alias grep=grep -i --color=auto'. I had to 
set that up myself, it won't be the default / what you have.

I would have expected your 'ls -l | grep [A-Z]' to have worked exactly 
as you expected, so something else is going on here.

If I wanted to do what you are doing, I would have to take specific 
action to get around my alias. e.g. delete the alias, or alias 
grep='grep', or something. (Since most of the time I want to operate 
case insensitive.)

> --color turns the red on or off.
> With none there is no indication of match vs no-match.

You should only be getting match results. Non matches aren't 
displayed, normally.

> PS: Working with AVG settings.

User Interface / tools / advanced settings / e-mail scanner - uncheck 
certify e-mail.




More information about the kwlug-disc mailing list