How to Add Printer in Linux !!

  • : Function ereg() is deprecated in /home/sparxsys_linux/www.linuxindya.com/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /home/sparxsys_linux/www.linuxindya.com/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /home/sparxsys_linux/www.linuxindya.com/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /home/sparxsys_linux/www.linuxindya.com/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /home/sparxsys_linux/www.linuxindya.com/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /home/sparxsys_linux/www.linuxindya.com/includes/file.inc on line 647.
  • : preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/sparxsys_linux/www.linuxindya.com/includes/unicode.inc on line 311.
  • : preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/sparxsys_linux/www.linuxindya.com/includes/unicode.inc on line 311.
  • : preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/sparxsys_linux/www.linuxindya.com/includes/unicode.inc on line 311.
  • : preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/sparxsys_linux/www.linuxindya.com/includes/unicode.inc on line 311.

There are many ways to configure printer in Linux system , in this blog we are sharing most common method through which a printer can be installed . . . .
we can add a printer by entering a printer capability definition in the system printer capability database, printcap. This file is found under the /etc directory, and is a text file that can be changed only by the root operator.

The format, commands, and syntax to use when creating a printer entry in the /etc/printcap file are found in the printcap manual page. There are more than 40 different commands, but you can quickly create a printer with only the mx (maximum size of spooled files) and sd (spool directory) commands.

Configuring a simple printer

1. To create a printer called mylp for the /dev/lp1 device, open the /etc/printcap file with your preferred text editor. The sd option tells the Linux printing daemon, lpd, where to temporarily place printed (spooled) files. The mx command, used with a value of 0, places no limit on the size of spooled files. Type an entry such as this:

mylp:\
:sd=/var/spool/lpd/mylp:\
:mx#0:\
:lp=/dev/lp1:

2. Save the entry, and then create the printer's spool directory by using the mkdir command:

# mkdir /var/spool/lpd/mylp

3. Make sure the directory lp has the correct group ownership and permissions by using the chgrp and chmod commands, as follows:

# chgrp lp /var/spool/lpd/mylp
# chmod 755 /var/spool/lpd/mylp

4. Test the printer entry with the lpr (line printer command) using the -P option to specify your newly created printer:

# lpr -Pmylp test.txt

5. Your printer should activate and print the test document.