LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   fedora linux-wildcard commands (https://www.linuxquestions.org/questions/linux-newbie-8/fedora-linux-wildcard-commands-915815/)

loukas texasll 11-27-2011 11:25 AM

fedora linux-wildcard commands
 
hello my name is loukas!
and i would like to ask if anybody know how can i use ls with wildcards to list all files that end in a between numbers?

frankbell 11-27-2011 07:15 PM

Assuming that you are talking about a file name such as 1somethingorother2.something, normal wildcards such as * and ? should work.

Code:

$ ls 1*2.txt
1and2.txt  1somethingorother2.txt
$ ls 1???2.txt
1and2.txt
$ ls *1*2*.*
1and2.txt
1somethingorother2.txt
joe1somethingorother2more.txt
joe1somethingorother2.txt

For something more complicated, you may need to use regular expressions. See man regex for more, then Google for links to make the man page understandable.


All times are GMT -5. The time now is 01:56 PM.