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.
5 Answers
You can use:
find -iname '*.pdf'
with ls maybe:
ls -lR | grep '/\|pdf$'
The easiest way (if you are using Ubuntu Desktop):
Go to your home folder in Nautilus, press Ctrl+F and search for .pdf.
You can also change the location and you can make your search more specific.
2@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.
Use find
find . -name '.pdf'See also:
5Use the command:
ls | grep .pdf 1 Simplest way will be:
locate *.pdfThis command will find all the PDF files present in your system.
1