Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Emacs backup files start with .# but I can find those in my directory. I've try:

find . -name '^\.#.*'


find . -name '.*#.*'

and they are not show up, and I have them. For instance if I create one just for test:

touch '.#test'

and if I try to find it using find command it not show up.

share|improve this question
up vote 4 down vote accepted
> touch .#test
> find . -name '.#*'

Works! find uses shell globbing, not regular expressions. . does not need to be escaped in the former because it is not a special character, it is always literal. The glob equivalent of the regexp wildcard . is ?. Also, * is a wildcard in globbing, the regexp equivalent of which is .* (* being a quantifier and not a wildcard in regexps).

share|improve this answer
Thanks, I thought that find use regex for -name. – jcubic Feb 15 '14 at 17:08
@jcubic no, only for --regex. Please remember to accept this answer if it solved your issue. – terdon Feb 15 '14 at 18:09
@terdon You always need to wait (I think half an hour) before accepting. – jcubic Feb 15 '14 at 20:46
@terdon long options with double minus for find (--regex)? I think you fell victim to habitual typing ;-) – Anthon Feb 16 '14 at 10:06

This answer may work well.

find . -regex ".*\.#.*"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.