Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

I would like to be able to search and delete files which have 2 separator "." in their names but all end with .gnucash or .log

e.g. PL.293892.gnucash

How do I do this please?

Normally I would select the files by using *.gnucash but this doesn't work.

I've tried "*. *.gnucash" but this doesn't work either.

share|improve this question
Are you doing command line or GUI? – Thomas Ward Apr 18 '13 at 15:45
up vote 1 down vote accepted

*.gnucash (or the like) will work in any normal shell (zsh, bash, tcsh, ksh, sh etc.)

If this is not working, then either you're using some shell that is not behaving in an expected way (not sure if globbing like this is a posix standard or not. I'll look that up in a moment), or, more likely, there are extra characters (spaces, or otherwise nor printable characters) after the final extension. e.g. "PL.234234.gnucash " (note the space there) or some such.


ls *.gnucash*

to see if you can list those files. If you can, then you have the answer (extra characters).

Otherwise, which shell are you trying this in? Is it in a shell, or some other application?

share|improve this answer
When I use the command ls .gnucash it works great. But when I use this in the command line that I'm writing it doesn't work. – Peter Apr 18 '13 at 16:44
I've got it working thank you - your answer was correct adding the extra * at the end of the file extension did the trick - I hadn't written the command line correctly to use it. – Peter Apr 18 '13 at 17:01

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.