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

I once saw a colleague uses a tool which allows to use ** to represent any directories. For example: if a file called myfile.java sits deep inside:


A command in the parent of src directory:

ls **/myfile.java

can list the file.

Can anyone tell me what tool it is? What package I need to use on Ubuntu to achieve this?

share|improve this question
I think it is a dirty shellhack, dots always need special treatment when they are in a specific role. – vakufo Mar 12 '12 at 18:47
Hi. Sorry. I made a mistake. It is not ... but **. I have changed the original post. – Kevin Zhang Mar 12 '12 at 19:13
up vote 5 down vote accepted

Try using the globstar option in bash; I believe that zsh has a similar option.

$ shopt -s globstar
$ echo pylib/**/pyerector.py
pylib/pyerector.py pylib/pyerector/pyerector.py

You can read more about it in the manpage.

share|improve this answer
On zsh it's activated by default. – Stéphane Gimenez Mar 12 '12 at 19:11
Note that it's only available in version 4 of bash. – Ignacio Vazquez-Abrams Mar 12 '12 at 19:27

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.