HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
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.

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 "..?*" \)