Questions tagged [wildcard]

A wildcard character is any character that can be used to substitute for any other character or characters in a string.

A wildcard character is any character that can be used to substitute for any other character or characters in a string.

Examples (in many DOS/Unix systems):

* - Any sequence of characters.
? - Any single character.

4120 questions
728
votes
4 answers

wildcard * in CSS for classes

I have these divs that I'm styling with .tocolor, but I also need the unique identifier 1,2,3,4 etc. so I'm adding that it as another class tocolor-1.
tocolor 1
tocolor 2 …
twitter
  • 7,975
  • 6
  • 20
  • 19
473
votes
17 answers

Why is using a wild card with a Java import statement bad?

It is much more convenient and cleaner to use a single statement like import java.awt.*; than to import a bunch of individual classes import java.awt.Panel; import java.awt.Graphics; import java.awt.Canvas; ... What is wrong with using a wildcard…
jnancheta
  • 5,968
  • 8
  • 23
  • 18
402
votes
32 answers

Select all columns except one in MySQL?

I'm trying to use a select statement to get all of the columns from a certain MySQL table except one. Is there a simple way to do this? EDIT: There are 53 columns in this table (NOT MY DESIGN)
Tom Grochowicz
  • 4,797
  • 3
  • 18
  • 18
324
votes
14 answers

Get a filtered list of files in a directory

I am trying to get a list of files in a directory using Python, but I do not want a list of ALL the files. What I essentially want is the ability to do something like the following but using Python and not executing ls. ls 145592*.jpg If there is…
mhost
  • 5,700
  • 4
  • 34
  • 43
320
votes
21 answers

Check if a file exists with wildcard in shell script

I'm trying to check if a file exists, but with a wildcard. Here is my example: if [ -f "xorg-x11-fonts*" ]; then printf "BLAH" fi I have also tried it without the double quotes.
Danny
  • 4,422
  • 6
  • 24
  • 28
238
votes
16 answers

Unzip All Files In A Directory

I have a directory of ZIP files (created on a Windows machine). I can manually unzip them using unzip filename, but how can I unzip all the ZIP files in the current folder via the shell? Using Ubuntu Linux Server.
Lennie De Villiers
  • 4,581
  • 7
  • 29
  • 30
170
votes
17 answers

How to find files that match a wildcard string in Java?

This should be really simple. If I have a String like this: ../Test?/sample*.txt then what is a generally-accepted way to get a list of files that match this pattern? (e.g. it should match ../Test1/sample22b.txt and ../Test4/sample-spiffy.txt but…
Jason S
  • 171,795
  • 155
  • 551
  • 900
146
votes
4 answers

Find all elements on a page whose element ID contains a certain text using jQuery

I'm trying to find all elements on a page whose element ID contains a certain text. I'll then need to filter the found elements based on whether they are hidden or not. Any help is greatly appreciated.
user48408
  • 3,004
  • 10
  • 33
  • 54
135
votes
9 answers

When to use generic methods and when to use wild-card?

I am reading about generic methods from OracleDocGenericMethod. I am pretty confused about the comparison when it says when to use wild-card and when to use generic methods. Quoting from the document. interface Collection { public boolean…
benz
  • 4,171
  • 6
  • 31
  • 55
113
votes
2 answers

Why does "_" (underscore) match "-" (hyphen)?

I have to look for a PDF manual using this query: root@localhost:test> select * from a where name like '%taz_manual%.pdf%'; +--------------------+------------------+-------------+ | name | description | size |…
E.G.
  • 2,808
  • 3
  • 18
  • 23
102
votes
4 answers

How to use a wildcard in the classpath to add multiple jars?

I have been using so many 3rd party libraries(jar files) that my CLASSPATH is completely messed up as i have to include the path for every single jar file that i use. I've been wondering if there is a way to include all the jar files in a folder…
paulbullard
  • 1,107
  • 2
  • 8
  • 8
95
votes
5 answers

What expands to all files in current directory recursively?

I know **/*.ext expands to all files in all subdirectories matching *.ext, but what is a similar expansion that includes all such files in the current directory as well?
Ramon
  • 7,604
  • 3
  • 30
  • 41
94
votes
5 answers

rsync not synchronizing .htaccess file

I am trying to rsync directory A of server1 with directory B of server2. Sitting in the directory A of server1, I ran the following commands. rsync -av * server2::sharename/B but the interesting thing is, it synchronizes all files and directories…
Sangfroid
  • 1,255
  • 2
  • 9
  • 5
94
votes
4 answers

Stop shell wildcard character expansion?

Is there any way for a compiled command-line program to tell bash or csh that it does not want any wildcard characters in its parameters expanded? For instance, one might want a shell command like: foo * to simply return the numeric ASCII value of…
hotpaw2
  • 68,014
  • 12
  • 81
  • 143
86
votes
4 answers

What do double-asterisk wildcards mean?

I've tried the following command but I am having trouble interpreting it: ls ** but I'm not sure exactly what it is outputting and why that is the result.
Mike Blair
  • 991
  • 1
  • 7
  • 8
1
2 3
99 100