• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Add Network Printer via Command Line in CentOS/RHEL

by admin

This post explains the steps to add a network printer on a Linux Server.

1. Verify if new printer already exists

# lpstat -p
Note: This command will list all installed printers.

2. Verify if printer has a DNS record:

# host [printer name]

3. If error found in verifying if printer has a DNS record, modify /etc/hosts:

# echo "[printer IP address] [printer name]" >> /etc/hosts
Note: Modifying /etc/hosts can be done manually by using vi command.

4. Add printer:

# lpadmin -p [printer name] -E -v socket://[printer name]:[port]

5. Verify if printer has been installed successfully:

# lpstat -p | grep [printer name]

or

# ping [printer name]
Note: Do not modify /etc/cups/printers.conf configuration file directly. Use the lpadmin command to add or remove printers.
How to Remove Network Printer in CentOS/RHEL

Filed Under: CentOS/RHEL, CentOS/RHEL 6, CentOS/RHEL 7, CentOS/RHEL 8, Linux

Some more articles you might also be interested in …

  1. 10 useful cron examples to schedule jobs in Linux
  2. chpasswd Command Examples in Linux
  3. dolt blame: Displays commit information for each row of a Dolt table
  4. UNIX / Linux : How crontab validates the access based on the cron.allow and cron.deny files
  5. func: Azure Functions Core Tools: Develop and test Azure Functions locally
  6. aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  7. UNIX / Linux : What is the correct permission of /tmp and /var/tmp directories
  8. How to Configure Password Expiration and Complexity Requirements in CentOS/RHEL
  9. Magento 2.3.3 Redis cache grows unlimited
  10. register_new_matrix_user Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • gml2gv Command Examples
  • glow Command Examples
  • glib-compile-resources Command Examples
  • glances Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright