Changes

Jump to: navigation, search
Filename Expansion
''Examples:''
You issued the '''ls''' command to view all of the files contained in your current directory:  <span style="color:blue;font-family:courier;>'''ls'''<br>a.txt b.txt c.txt 1.txt 2.txt 3.txt abc.txt work.txt webpage.html picture.png</span>  You now want to list just text files (i.e. files with the extension ".txt").<br>One method to do this is to issue the ls command and specify each file pathname as a separate argument:  <span style="color:blue;font-family:courier;>'''ls a.txt b.txt c.txt 1.txt 2.txt 3.txt abc.txt work.txt'''<br>a.txt b.txt c.txt 1.txt 2.txt 3.txt abc.txt work.txt</span> [[Image:globbing-demo-2.png|thumb|right|400px|'''Globbing''' is the process of expanding filenames as separate arguments that match an argument that uses a '''wildcard symbol'''<br>(such as '''*''').]]But this method is '''inefficient''': it requires a LOT of typing and knowing which filenames to include as separate arguments. You can use a special character to indicate to the Bash shell to match all files that end with the extension ".txt":
13,420
edits

Navigation menu