Changes

Jump to: navigation, search
Ambiguous Filename Expansion
Assume the following regular files exist in your current directory
'''ls'''<br>
a.txt b.txt c.txt 1.txt 2.txt 3.txt abc.txt work.txt webpage.html picture.png
If you wanted to list just text files (i.e. files with the extension ".txt"), one way is to issue a command and specify each file pathname as a separate argument:
'''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
But there is no need to type all of those file pathnames 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":
'''ls *.txt'''<br>
a.txt b.txt c.txt 1.txt 2.txt 3.txt abc.txt work.txt
13,420
edits

Navigation menu