I am using the command lp -d (printer_name) * to print all files in the current directory.

How can I print the page number also:

'Page-1' or '1'

on each page per file printed?

  • 3
    To print simple text files with page numbers look at enscript. – meuh Apr 19 '18 at 16:56
  • 2
    That example is confusing. Should "or" be printed a the bottom of each page? – agc Apr 19 '18 at 19:08
  • 2
    What kind of files? Text files? Use pr. Pdf or postscript files? That's more difficult. What do you use for printing? CUPS? – dirkt Apr 22 '18 at 9:38
  • 1
    Other tools which can do the things you describe are a2ps (mostly for text files) and the latex package pdfpages (on which various tools like pdfbook are based, see e.g. stackoverflow.com/questions/1603301/…) for pdf files.You see it depends on the context, you should be more precise about this in your question. – alphanum Apr 23 '18 at 14:20
  • lpr has a -p option: Specifies that the print file should be formatted with a shaded header with the date, time, job name, and page number. – Patrick Mevzek Apr 24 '18 at 2:18

Your Answer

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

Browse other questions tagged or ask your own question.