Metacharacters and Hidden Files
❏ More examples of filename substitution:
$ cp * backup [Return]
This copies all files from the current directory to the backup directory.
$ mv file[1-4] memos [Return]This move file1, file2, file3, and file4, indicated by the range [1–4], to the memosdirectory.
$ rm report* [Return]This deletes all the filenames that start with the string report.
There is no space between the string report and the asterisk wildcard.
$ rm report * [Return]
This deletes all the files.
In the preceding example, there is a space between the stringreport and the asterisk wild card. This space can have disastrousconsequences.
The command rm report * is interpreted as “delete a file calledreport, and then delete all the other files.’’
In other words, all files in the current directory are deleted.