Filename Metacharacters

  • * Match any string of zero or more characters.
  • ? Match any single character.
  • [abc…] Match any one of the enclosed characters; a hyphen can specify a
  • range (e.g., a-z, A-Z, 0–9).
  • [!abc…] Match any character not enclosed as above.
  • ̃ Home director y of the current user.
  • ̃name Home director y of user name.
  • ̃+ Current working director y ($PWD).
  • ̃- Pr evious working director y ($OLDPWD).

 

With the extglob option on:

  • ?(pattern) Match zero or one instance of patter n.
  • *(pattern) Match zero or more instances of patter n.
  • +(pattern) Match one or more instances of patter n.
  • @(pattern) Match exactly one instance of patter n.
  • !(pattern) Match any strings that don’t match patter n.
Advertisements