| |
Wild card characters |
* , ? , [] ,-, . ,^,$ |
| |
|
|
|
| wild card character |
Description |
| |
|
| * |
It matches one or more characters |
| ? |
It matches any single character |
| [] |
It matches any single character in the given list |
| - |
It matches any character in that range |
| . |
It matches any single character except enter key character. |
| ^ |
It displays line which starts with that character |
| $ |
It displays line which ends with that character. |
|
| |
Examples :: |
| |
| * wild card |
| |
|
| $ ls t* |
|
It displays all files starting with 't' character. |
| $ ls *s |
It displays all files ending with 's' |
| $ ls b*k |
It displays all files starting with b and ending with k |
|
| ? wild card |
|
| $ ls t?? |
|
It displays all files starting with 't' character and also file length must be 3 characters.. |
| $ ls ?ram |
It displays all files starting with any character and also the length of the file must be 4 characters. |
|
| - wild card |
|
| $ ls [a-z]ra |
|
It displays all files starting with any character between a to z and ends with 'ra'.The length of the file must be 3 characters. |
| |
|
|