Skip to main content
2 of 2
edited tags
user avatar
user avatar

Why "*" works differently in different commands?

For example, in rm -r abc* "*" means any string. However, if we use it in touch abc* abcd* abcde* (and we don't have any files in directory starting with abc or abcd or abcde) "*" means just a symbol, and files abc* abcd* abcde* will be created. If after that we will use touch -m ab* the modification time of files abc* abcd* abcde* will be changed.

Why in some cases "*" means any string, and in some cases it is just a symbol? how the computer know when to change it's meaning?

Gideon
  • 31
  • 1
  • 1
  • 3