Print many PDF files in a directory

I tried to print multuple pdf usin bash with
lp *.pdf
in the direcotry wiht interest pdf but only 1 file is printed,
how to solve?


Hi @matrixfede, and welcome!

One option, well the only one I can think of if the lp *.pdf command executed successfully for that one document, is writing a little bash script that loop thorough the files and exececute the command for each. Something like:

for file in directory do
    lp file

This is definitely not valid code and will not work. It is just to demonstrate the technique of my answer.

Also, it might not be the only answer out there.

man lp


1 Like

thankyou. I searched a lot by didn0t find anythings that works.

Although question is not about printing - but the principle is valid for printing too

I cannot say this will work for printing your files but if you can make one file print then you may be able to use something like this - please do adjust for your specific use case - I have not tested - just copy-pasted

This is actually what I initially thought would do it - but did a search so maybe you could learn from it :slight_smile:

$ find -name '*.pdf' -exec lp {} \;

thank you this works

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.