Say I want to use this command
`find ~ -name test*`
in a directory. In what kind of presence of files in this directory will conflicting "shell expansion" occur?
My points: - When There is space in file name. Captain obvious!
I can't think of any other cases. Please explain.
.
├── subdir
│ └── test2.dat
└── test.dat
1 directory, 2 files
If you don't use double quotes then the shell will expand test* to be test.dat and the final command will actually be: find . -name test.dat
...so the file named "test2.dat" in the sub-directory therefore won't be found.Instead of using double quotes you can escape the asterisk so it won't be processed by the shell, e.g.
find . -name test\*