0

In the command line, the wildcards do not seem to work. Am I just old-school and they are not used. The manuals seem to describe them. A search command for *.pl should find all perl scripts...

And *.pm should find all perl objects. thanks john

1
  • 1
    You've not posted the command in question, which makes it a bit hard to understand the question. locate *.pl and locate *.pm seem to find all the scripts and objects, and I hope that's what you meant. Dec 4, 2012 at 22:49

1 Answer 1

2

If you are in the directory of the scripts you need to use ls *.pm, if you want to search the subdirectories as well you are better of with the find command, you would then use

find . -name '*.pm'

The first argument is the parent directory to use: the dot means from the current directory and down, if you use / this means that the whole filesystem will be searched, depending on your files this might take a while.

I don't recommend using the locate command because it gets the information from a database that might not be up-to-date. So if you add a file it won't show up in your output unless you force the database to update by

sudo updatedb

See also the man pages for more info about these commands (eg. by doing man find)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .