ShellWildcards: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
(No difference)

Revision as of 18:15, 22 September 2009

~ 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).