mirror of
				https://github.com/onceupon/Bash-Oneliner.git
				synced 2025-11-03 22:51:07 +01:00 
			
		
		
		
	add more bash globbing examples
This commit is contained in:
		
							
								
								
									
										15
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								README.md
									
									
									
									
									
								
							@@ -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.
 | 
			
		||||
/b?n/?at     #/bin/cat
 | 
			
		||||
/etc/pa*wd   #/etc/passwd 
 | 
			
		||||
# '*' 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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user