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.

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

share|improve this question
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. –  mikewhatever Dec 4 '12 at 22:49
add comment

2 Answers

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)

share|improve this answer
add comment

sometimes wildcards or special ciphers need a mask with '\' - backslash before every special cipher resp. wildcard ! ( the backslash is invisible in this block rather ... )

then type ... \*.jpeg instead of ... *.jpeg

or for example:

cp /home/user/\*.jpeg /home/Downloads/

share|improve this answer
    
rats ! - backslash is interpreted here as command and therefore invisible here in my posting above ? –  dschinn1001 Dec 5 '12 at 9:18
add comment

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.