cancel
Showing results for 
Search instead for 
Did you mean: 

dot files

SOLVED
Go to solution
nightwich
Valued Contributor

dot files

How to list all files that start whit a dot ( ex .aj .cshrc etc ) from one directories and is sub-directories


4 REPLIES
Pete Randall
Outstanding Contributor
Solution

Re: dot files

find /startdir -name ".*"


Pete

Pete
Patrick Wallek
Honored Contributor

Re: dot files

>>find /startdir -name ".*"

The problem there is that it'll pick up ".." as well, which is probably not wanted.

Try this:

find /startdir -name ".[a-zA-Z0-9]*"

The above will find any dotfile that starts with a lower case letter, upper case letter, or a digit.
nightwich
Valued Contributor

Re: dot files

I already have tried those options but without the ("). That was the problem.


Thanks for the answer ten points !!


Best regards.

Dennis Handly
Acclaimed Contributor

Re: dot files

>Patrick: find /startdir -name ".[a-zA-Z0-9]*"

Or use the following to exclude the ".": -name ".[!.]*"

This won't find "..abc". To get those:
\( -name ".[!.]*" -o -name "..?*" \)