# NSCI 580A4 fall 2017

### Sidebar

NSCI 580A4

Instructors
Tai Montgomery
Erin Nishimura

wiki:2016wildcards

# WILDCARDS

Please Refer to Chapter 4 in the textbook, The Linux Command Line, for detailed discussion on wildcards. Today, we will just cover two types of wildcards, * and ?.

In addition to instructing the shell to perform operations on specific files or directories, we can use wildcards to ask the shell to perform operations on groups of filenames or directories with shared properties.

* will match any string of characters
? will match any individual character

Exercise: What will the following commands do?

$ls file1.txt file2.txt file100.txt dir1 dir2$ls -d
dir1 dir2
$cp *.txt dir1$cp file?.txt dir2

Common pitfall: rm and * are a dangerous combination. Please use care in removing items with wildcards and always use rm interactively.