Technofunction

Configuring/Installing printer and printing in Linux

Basics of Printer in Linux:-

  • Printing in Red Hat Enterprise Linux is handled by Cups i.e. Common Unix Printing System which handles all print related jobs.
  • Printers may be locally connected to a PC or a networked printer. Print request by a user  is sent in the form of queues which are served on the first come and first served basis. These jobs may be canceled before or  during the printing.

Commands Associated With Printers:-

  • system-config-printer is a graphical tool for configuring printers or you can alternative use system>administration>printing.
  • lpr (Local/Line print request) sends job to the queue that is to be printed.
  • lpq (Line print queue) is used to view the contents of a queue.
  • lprm (line print request remove) removes a job from the queue.
  • Other commands like lp, lpstat and cancel are also supported in Linux.

-p argument is used to select a queue other than the default

-# argument is used to specify number of copies

Follow the following commands to print a file:

  • #system-config-printer

  • Select the New Printer from tab to Configure a New Printer

  • Next select your desired Printer name, Description, Location of your printer and once done click forward to continue.

(more…)

Formatting a Pen Drive in Centos/ RedHat Linux

You will be needing a root login or atleast root priveledge to execute the follwing commands in Linux. If you logged in as root than use following commands directly if not add “sudo” followed by the command.

Format a pen drive in Linux with the following steps:

Connect your pen drive to the system running Linux and let it get detected and mounted.  Now open a Terminal.

  • dmesg |tail : it lets you know what form of drive letters have Linux assingned to your pendrive. Remember pendrive is detected as a sata device so it starts with letter “sd” in Linux. Consider the output of following command at terminal

[root@ankit ~]# dmesg |tail

sdg: Write Protect is off
sdg: Mode Sense: 23 00 00 00
sdg: assuming drive cache: write through
SCSI device sda: 4030464 512-byte hdwr sectors (2064 MB)
sdg: Write Protect is off
sdg: Mode Sense: 23 00 00 00
sdg: assuming drive cache: write through

sdg:
sd 0:0:0:0: Attached scsi removable disk sdg
sd 0:0:0:0: Attached scsi generic sg0 type 0

Note the terms that have been shown in bold. This is the extension that Linux has assingned to your pen drive. “g” is the unique character that Linux has assingned to sata drive. The above term may differ in your system so make sure you replace the command below with the appropriate term as occur in your system.

Concept of the i-Nodes and Superblocks in Linux/Unix System

The fundamental building block of  UNIX file systems (including Linux’s ext2/ext3) is the i-node. An i-node is a control structure that points either to the other i-nodes or to data blocks.

Creation of a file system is associated with creation of data structures which contains the information about the file. Each file is assigned a unique inode number or i-number. Every file in the system is identified with the corresponding inode number.

The control information in the i-node includes the file’s owner, permissions, size, time of last access, creation time, group ID, etc. ( the entire kernel data structure is available in /usr/src/linux/include/linux/ext3_fs.h—assuming, of course, that you have the source tree installed in the /usr/src directory). A typical allocation of space alloted to inode in a file system is about 1% of the total size.

Inode number can be found using:-

$ ls -i

$ ls -l

The one thing that an i-node doesn”t  keep is the file’s name.

(more…)