4

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:

src/main/com/mycompany/product/store/myfile.java

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?

  • 1
    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
  • 2
    Hi. Sorry. I made a mistake. It is not ... but **. I have changed the original post. – Kevin Zhang Mar 12 '12 at 19:13
5

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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