add more bash globbing examples

This commit is contained in:
I-Man Ng 2019-05-14 12:30:18 +08:00 committed by GitHub
parent 1f64f38cc5
commit c64c6fbf50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,10 +92,17 @@ Esc + c
##### Bash globbing
```bash
# '*' character serves as a "wild card" for filename expansion.
# '?' character serves as a single-character "wild card" for filename expansion.
# '*' serves as a "wild card" for filename expansion.
/b?n/?at #/bin/cat
# '?' serves as a single-character "wild card" for filename expansion.
/etc/pa*wd #/etc/passwd
# [] serves to match the character from a range.
ls -l [a-z]* #list all files with alphabet in its filename.
# {} can be used to match filenames with more than one patterns
ls {*.sh,*.py} #list all .sh and .py files
```
##### Some handy environment variables