How to find all PDF files in directories and their subdirectories?

I want to list all PDF files in the directories of the current working directory. What command can do this?

I remember a combination of ls and */*.pdf but don't remember what exact combination.

1

5 Answers

You can use:

find -iname '*.pdf'

with ls maybe:

ls -lR | grep '/\|pdf$'

4

The easiest way (if you are using Ubuntu Desktop):

Go to your home folder in Nautilus, press Ctrl+F and search for .pdf.

Screenshot showing search process

You can also change the location and you can make your search more specific.

@WarriorIng64 Note that this on its own will locate all files with .pdf occurring anywhere in the filename. If you specifically want files that the system identifies as PDFs, click the green + button next to "Reload", add the "File Type" "Pdf / Postscript" filter and click "Reload" to get only actual PDFs. enter image description here

2

Use find

find . -name '.pdf'

See also:

5

Use the command:

ls | grep .pdf
1

Simplest way will be:

locate *.pdf

This command will find all the PDF files present in your system.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like