You're simply missing the predicate that says what you're searching by (e.g.
To find in home directory by name:
find ~ -name \*.pdf
Note that the wildcard
* has to be escaped so that the shell doesn't interpret it before find gets its hands on it. Using
"*.pdf" will have the same effect as
To find case-insensitively:
find ~ -iname \*.pdf
To prune the results to files only (the name expression will probably take care of this for you, but just in case you have any weirdly-named directories):
find ~ -type f -iname \*.pdf
To make sure find follows symbolic links (I usually want to do this myself when doing searches):
find ~ -follow -type f -iname \*.pdf
To do something with the files you found: you can dump this to a file using stdout redirection (e.g. tack on
> filename at the end), or use the
-exec option to run a command (see the man page for details). The latter runs a command on each file at a time, though. it's often faster to let the
xargs command pass your found files as arguments to another command, all at once or big chunks at a time. For example, for ad-hoc (but unindexed) greps through header files:
find ~ -follow -type f -name \*.h | xargs grep -nH "identifier"
And one final extension, to make that last command work properly if you have files & directories with spaces in them:
find ~ -follow -type f -name \*.h -print0 | xargs -0 grep -nH "identifier"