Why can't I use a command like this to find all the pdf files in a directory and subdirectories? How do I do it? (I'm using bash in ubuntu)
ls -R *.pdf
How would I then go about deleting all these files?
find is your answer.
is recursive listing of pdf files.
lists all .pdf files, including for example
Also, you can use ls for limited number of subfolders, for example
to find all pdf files in subfolders (matches to bar/foo.pdf, not to bar/foo/asdf.pdf, and not to foo.PDF).
If you want to remove files found with find, you can use
As others have said, find is the answer.
Now to answer the other part.
Should do it.