ShellWildcards: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
 
No edit summary
 
Line 1: Line 1:
{| border="1"
{| class="wikitable"
| ~ || path of users home directory (aka $HOME) ||
| ~ || path of users home directory (aka $HOME)
|-
|-
| ? || Any single character ||
| ? || Any single character
|-
|-
| * || Any string of characters ||
| * || Any string of characters
|-
|-
| [aeiou] || Any vowel ||
| [aeiou] || Any vowel
|-
|-
| [!aeiou] || Any character that's not a, e, i, o, or u ||
| [!aeiou] || Any character that's not a, e, i, o, or u
|-
|-
| {jpg,gif} || either "jpg" or "gif" ||
| {jpg,gif} || either "jpg" or "gif"
|-
|-
|}
|}

Latest revision as of 18:46, 14 September 2010

~ path of users home directory (aka $HOME)
? Any single character
* Any string of characters
[aeiou] Any vowel
[!aeiou] Any character that's not a, e, i, o, or u
{jpg,gif} either "jpg" or "gif"

example:

ls images/Project[4-6].txt

matches:

  • images/Project4.txt
  • images/Project5.txt
  • images/Project6.txt

but not:

  • images/Project3.txt

and

mv foo/*.{jpg,gif} images

is handy for moving all the image files from one directory (foo) to another (images).