In this chapter, we will talk about in detail about Printing and Email as the basic utilities of UNIX. So far, we have tried to recognize the Unix OS and the nature of its basic commands. In this episode, we will learn some vital UNIX utilities that can be used in our day-to-day life.
Before you print a file on a UNIX system, you may want to reformat it to regulate the margins, highlight some words, and so on. Most files can also be printed without reformatting, but the raw printout may not be that attractive.
Several versions of UNIX include two powerful text formatters, ruff and trough.
The pr command does small formatting of files on the terminal screen or for a printer. For instance, if you have a long list of names in a file, you can format it onscreen into two or more columns.
Following is the syntax for the pr command –
The pr changes the format of the file only on the screen or on the printed copy; it doesn't change the unique file. Following table lists some pr options −
|S.No.||Option & Description|
Before using pr, here are the contents of a sample file named food.
Let's use the pr command to make a two-column description with the header Restaurants –
The command lap or lord prints a file onto paper as opposite to the screen display. Once you are prepared with formatting using the pr command, you can use any of these commands to print your file on the printer associated to your computer.
Your scheme administrator has most likely set up a default printer at your site. To print a file named food on the default printer, use the lap or lord command, as in the following instance –
The lap command shows an ID that you can use to cancel the print job or check its position.
The upstate command show what's in the printer queue: request IDs, owners, file sizes, when the jobs were sent for printing, and the status of the requests.
Use upstate -o if you want to observe all output requests other than just your own. Requests are exposed in the order they'll be printed –
The lap gives slightly different information than upstate -o –
Here the first line displays the printer status. If the printer is disabled or running out of paper, you may observe different messages on this first line.
The cancel command terminates a printing request from the lap command. The plum command terminates all lord requests. You can identify either the ID of the request (displayed by lap or lap) or the name of the printer.
To cancel whatever request is presently printing, regardless of its ID, just enter cancel and the printer name –
The plum command will cancel the active job if it belongs to you. Otherwise, you can give job numbers as influence, or use a dash (-) to eliminate all of your jobs –
The plum command tells you the concrete filenames disconnected from the printer queue.
You use the UNIX mail command to send and accept mail. Here is the syntax to send an email –
Here are main options connected to mail command −s
|S.No.||Option & Description|
Following is an instance to send a test message to firstname.lastname@example.org.
You are then accepted to type in your message, followed by "control-D" at the creation of a line. To stop, simply type dot (.) as follows –
You can send a total file using a redirect < operator as follows –
To check received email at your UNIX system, you simply type email as follows –
Unix/Linux Related Interview Questions
|Perl Scripting Interview Questions||Shell Scripting Interview Questions|
|Python Interview Questions||Core Java Interview Questions|
|Linux Interview Questions||Linux Embedded systems Interview Questions|
|Red Hat Linux System Administration Interview Questions||IBM AIX Interview Questions|
|Sybase Interview Questions||IBM AIX 7 Administration Interview Questions|
|Unix Shell Scripting Interview Questions||Linux Shell Scripting Interview Questions|
Unix/Linux Related Practice Tests
|Perl Scripting Practice Tests||Shell Scripting Practice Tests|
|Python Practice Tests||Core Java Practice Tests|
|Linux Practice Tests||Linux Embedded systems Practice Tests|
|Red Hat Linux System Administration Practice Tests||IBM AIX Practice Tests|
|Sybase Practice Tests||IBM AIX 7 Administration Practice Tests|
|Autosys Practice Tests|
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.