ls -R *.pdf would invoke
ls recursively on anything matching
*.pdf (if there's nothing matching
*.pdf in the current directory, you'll get no result, and if there is, it will only recurse into it if it's a directory).
ls -R | grep pdf would show you everything in the
ls -R result that matches the regular expression
pdf, which is not what you want.
This is what you need:
find myfolder -type f -name '*.pdf'
This will give you the pathnames of all regular files (
-type f) in or below the
myfolder directory whose filenames matches the pattern
*.pdf. The pattern needs to be quoted to protect it from the shell.
zsh shell (which recently became the default shell on macOS):
print -l myfolder/**/*.pdf(.ND)
This would print out the pathnames of all regular files in or below the directory
myfolder that have names ending in
.pdf, in a single column. The matching would include hidden names, and it would print an empty line if there was no matches. The
D in the glob qualifier corresponds to setting the
dotglob shell options in the
bash shell (but only for this single globbing pattern), and the dot makes the pattern only match regular files (i.e. not directories etc.)