File and Directory Management
Understanding File Permissions
Back to the introduction
To allow us to select strings containing a specific pattern, the C-Shell supports
% cp foo/*.cpp /tmp
The wildcard characters and their meaning are:
| Wildcard | Meaning |
|---|---|
| Matches any string, including the empty string | |
| Matches any single character | |
| Matches any character in the range specified by |
|
| Matches any character or string that starts with the character specified
by |
When csh encounters a wildcard character that is not contained between single ['] or
double ["] quotes, it performs a wildcard substitution. Because [*] matches any string,
using [*] in the pathname
Also, as we have seen in the previous section, if we use an asterisk as an index to reference list elements, then the value is the list itself. We will see more examples that use wildcard characters this way in the upcoming sections.
Let us look at some more examples:
% ls -FR a.c b.c cc.c dir1/ dir2 dir1: d.c e.e dir2: f.d g.c h.x i.y j.z % ls *.c a.c b.c cc.c % ls ?.c a.c b.c % ls [ac]* a.c cc.c % ls dir*/*.c dir1: d.c dir2 g.c % ls dir2/[g-i]* g.c h.x i.y
File and Directory Management
Understanding File Permissions
Back to the introduction
Copyright (C) 2000 - 2002, The University of British Columbia