Linux: Printing of Files

lpr, lpq, and lprm

  • With the printer commands such as lpr and lprm, you can perform printing operations such as printing files or canceling the print jobs
  • You can use the lpr command to send files to the printer connected to your system
  • In the following example user prints the content of the file suvarni

Example: lpr suvarni

  • If you want to print several files at once, you can specify more than one file on the command line after the lpr command
  • In the f example, the user prints out the contents of both the files suvarni and gokul

Example: lpr suvarni gokul

  • Printing jobs are placed in a queue and printed one at a time in the background. You can continue with other work as your files are getting printed
  • You can see the position of a particular printing job at any given time with the lpq command, which gives the owner of the printing job (the login name of the user who sent the job), the print job ID, the size in bytes, and the temporary file in which it is currently held
  • Using lprm command you can cancel an unwanted printing job. The command lprm takes as its argument either the ID number of the printing job or the owner’s name. It then removes the print job from the print queue. For this task, lpq is helpful, for it provides you with the ID number and owner of the printing job you need to use with lprm

Linux: Displaying contents of files << Previous
Next>> Linux: Managing Directories

Our aim is to provide information to the knowledge seekers. 

comments powered by Disqus