[ale] Need help with RE in egrep

Björn Gustafsson bg-ale at bjorng.net
Mon Sep 20 06:13:19 EDT 2010


I think the right answer is "find *" instead of "find ." if you only
want to exclude top-level "hidden" names.

On Sat, Sep 18, 2010 at 2:19 PM, Jim Lynch
<ale_nospam at fayettedigital.com> wrote:
> I've been using regular expressions for years, but sometimes I just
> can't find the right answer.  I'm trying to generate a list of files in
> a directory, excluding the top level hidden directories and files.
>
> I've tried the following and nothing seems to work.  Can someone please
> direct me to the right answer?
>
>   find . | egrep -v '^\.*' | more
>   find . | egrep -v '^\./\.*' | more
>   find . | egrep -v '^\.\/\.*' | more
>   find . | egrep -v '^\.\/\.*$' | more
>
> The output of file . is like
>
> ./file
> ./.hidden
>
> I didn't think I need to escape the slash but out of desperation I tried it.
>
> Thanks,
> Jim.

-- 
Björn Gustafsson



More information about the Ale mailing list