mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-11-26 06:17:01 +00:00
add more bash globbing examples
This commit is contained in:
parent
1f64f38cc5
commit
c64c6fbf50
11
README.md
11
README.md
@ -92,10 +92,17 @@ Esc + c
|
|||||||
|
|
||||||
##### Bash globbing
|
##### Bash globbing
|
||||||
```bash
|
```bash
|
||||||
# '*' character serves as a "wild card" for filename expansion.
|
# '*' serves as a "wild card" for filename expansion.
|
||||||
# '?' character serves as a single-character "wild card" for filename expansion.
|
|
||||||
/b?n/?at #/bin/cat
|
/b?n/?at #/bin/cat
|
||||||
|
|
||||||
|
# '?' serves as a single-character "wild card" for filename expansion.
|
||||||
/etc/pa*wd #/etc/passwd
|
/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
|
##### Some handy environment variables
|
||||||
|
Loading…
Reference in New Issue
Block a user