I am learning the linux utility find and am finding the man page difficult to read. I have defaulted to testing the command and seeing what it does.
I have a file called creek.jpg on my desktop.
When I type
find ~/Desktop creek.jpg
It appears to print out every file in my desktop, then prints out
find: creek.jpg: No such file or directory
Here is my mental picture of how find is working. In the man page, it says finds job is to "walk a file hierarchy." Here is my mental image of how find works. A file hierarchy (also referred to in the man page as a directory tree.) is like an oak tree. Each fork in the tree is a directory. Each leaf or acorn on the tree is a file. Find is a hyperactive squirrel that scrambles up and down the tree, touching every leaf, acorn, and branch.
Since the first line of the man page says that find's job is to walk a file hierarchy, apparently find's main job is to not, as I first thought, to actually find stuff. Instead, its job is to scramble up and down the tree, visiting things. A side effect of visiting things is that you can tell it to look for things and it will tell you if it sees them.
Apparently I am failing at two parts: how to tell it to look for creek.jpg on my desktop, and how to tell it to NOT tell me about every last little branch and leaf it touches with it's excited squirrely paws.
So:
When I type the above command, why is it telling me everything it is visiting, and why is it telling me it did NOT find creek.jpg?
How do I get it to find creek.jpg?
How do I get it to NOT tell me every other file it visited on it's "walk of the file hierarchy"?
You have provided two paths (~/Desktop and creek.jpg in current folder) and haven't provided any matching criteria. Try find ~/Desktop -name creek.jpg