Menu

UNIX TUTORIALS - Unix - Basic Utilities

Unix - Basic Utilities

ADVERTISEMENTS

The pr Command:

OptionDescription
-kProduces k columns of output
-d Double-spaces the output (not on all pr versions).
-h "header"Takes the next item as a report header.
-tEliminates printing of header and top/bottom margins.
-l PAGE_LENGTHSet the page length to PAGE_LENGTH (66) lines. Default number of lines of text 56.
-o MARGINOffset each line with MARGIN (zero) spaces.
-w PAGE_WIDTHSet page width to PAGE_WIDTH (72) characters for multiple text-column output only.

ADVERTISEMENTS

Sending Email:

OptionDescription
-sSpecify subject on command line.
-cSend carbon copies to list of users. List should be a comma-separated list of names.
-bSend blind carbon copies to list. List should be a comma-separated list of names.

ADVERTISEMENTS

The pr Command:

pr option(s) filename(s)

$cat food
Sweet Tooth
Bangkok Wok
Mandalay
Afghani Cuisine
Isle of Java
Big Apple Deli
Sushi and Sashimi
Tio Pepe's Peppers
........
$

$pr -2 -h "Restaurants" food
Nov  7  9:58 1997  Restaurants   Page 1

Sweet Tooth              Isle of Java
Bangkok Wok              Big Apple Deli
Mandalay                 Sushi and Sashimi
Afghani Cuisine          Tio Pepe's Peppers
........
$

The lp and lpr Commands:

$lp food
request id is laserp-525  (1 file)
$

The lpstat and lpq Commands:

$lpstat -o
laserp-573  john  128865  Nov 7  11:27  on laserp
laserp-574  grace  82744  Nov 7  11:28
laserp-575  john   23347  Nov 7  11:35
$

$lpq
laserp is ready and printing
Rank   Owner      Job  Files                  Total Size
active john       573  report.ps              128865 bytes
1st    grace      574  ch03.ps ch04.ps        82744 bytes
2nd    john       575  standard input         23347 bytes
$

The cancel and lprm Commands:

$cancel laserp-575
request "laserp-575" cancelled
$

$cancel laserp
request "laserp-573" cancelled
$

$lprm 575
dfA575diamond dequeued
cfA575diamond dequeued
$

Sending Email:

$mail [-s subject] [-c cc-addr] [-b bcc-addr] to-addr

$mail -s "Test Message" admin@yahoo.com 

Hi,

This is a test
.
Cc: 

$mail -s "Report 05/06/07" admin@yahoo.com < demo.txt 

$mail
no email