$ rm Think\ Python:\ How\ to\ Think\ Like\ a\ Computer
\ Scientist\ 2014.pdf
rm: cannot remove ‘Think Python: How to Think Like a Computer’: No such file or directory
$ Scientist 2014.pdf: command not found
$ rm Think*
$
In the first rm
, I use autocompletion in bash to specify a file with a newline character in its filename, and it doesn't work because of the newline character.
In the second rm
, I use file expansion to avoid explicitly to specify the new line character. Why can file expansion avoid the problem? Doesn't file expansion expand to the full filename which contains the new line character too?