[PLUG] use of grep

Ritesh Khadgaray khadgaray at gmail.com
Fri May 25 17:07:59 IST 2007


On Thu, 2007-05-24 at 23:02 +0530, BVK wrote:
> On 5/24/07, Dhiraj Khot <dhiraj at augusttechnologies.com> wrote:
> 
> > If I use
> > $ file .*
> > The output of the command is listing of all the files / directories that
> > begin with .
> > I want to have same output using grep command. So I tried
> > $ ls -a | grep .
> > This lists all the files and not the files which have . in its name.
> 
> Are you sure? It lists ALL files, not just those with . in their name.
"." has a special meaning for regular expression search .
check man page

	$ man grep
> 
> In GNU bash try
> 
> ls -a | grep \\.
> ls -a | grep ^\\.

ls -a | grep \.

> 
> 
> / bvk-chaitanya
> 
> --
> ______________________________________________________________________
> Pune GNU/Linux Users Group Mailing List:      (plug-mail at plug.org.in)
> List Information:  http://plug.org.in/cgi-bin/mailman/listinfo/plug-mail
> Send 'help' to plug-mail-request at plug.org.in for mailing instructions.
-- 
Ritesh Khadgaray
ॐ मणि पद्मे हूँ
LinuX N Stuff
Ph: +919970164885
Eat Right, Exercise, Die Anyway.





More information about the Plug-mail mailing list