Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
1  
Are you doing command line or GUI? –  Thomas W. Apr 18 '13 at 15:45

1 Answer 1

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.

try:

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

 
discard

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.