[PLUG] use of grep

yogesh ykchavan at gmail.com
Thu May 24 21:31:57 IST 2007


On 5/24/07, Dhiraj Khot <dhiraj at augusttechnologies.com> wrote:
> Hello,
> I have a question.
> 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.
>
> Can someone tell me why? What is that I am doing it wrong ?
>
> Regards,
> Dhiraj

try
$ls -ld .*
also to display only hidden directories
$ls -ld .* | grep ^d
for hidden files
$ls -ld .* | grep ^-

---
yogesh chavan

""In order to make an apple pie from scratch, you must create universe first"
-- Carl Sagan, Cosmos




More information about the Plug-mail mailing list