Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • not necessarily ending with .pdf....this will count all files containing .pdf, like image.pdf0001.jpg... Commented May 21, 2016 at 14:37
  • and ls will list folders as well, if any subfolder contains the .pdf characters, those will be counted too. Commented May 21, 2016 at 14:51
  • and lastly, you should specify what exactly is your wanted result, because the command you've given might produce the wanted result. Commented May 21, 2016 at 14:53
  • @roaima: the OP asked to count "the *.pdf files", not "the PDF files", so the answers do address the question. :-) Commented May 21, 2016 at 17:49