UNIX Tutorial Four
UNIX Tutorial Four
4.1 Wildcards
The * wildcard
The character * is called a wildcard, and will match against none or more character(s) in a file (or directory) name. For example, in your unixstuff directory, type % ls list* This will list all files in the current directory starting with list.... Try typing % ls *list This will list all files in the current directory ending with ....list
The ? wildcard
The character ? will match exactly one character. So ?ouse will match files like house and mouse, but not grouse. Try typing % ls ?list
File names conventionally start with a lower-case letter, and may end with a dot followed by a group of letters indicating the contents of the file. For example, all files consisting of C code may be named with the ending .c, for example, prog1.c . Then in order to list all files containing C code in your home directory, you need only type ls *.c in that directory.
Apropos
When you are not sure of the exact name of a command, % apropos keyword will give you the commands with keyword in their manual page header. For example, try typing % apropos copy
Summary
Command * ? man command Meaning match any number of characters match one character read the online manual page for a command
whatis command brief description of a command apropos keyword match commands with keyword in their man pages