Upcoming Events

Cloud Connect
Santa Clara
Feb 13-16, 2012

Cloud Connect brings together the entire cloud eco-system to better understand the transformation we're experiencing and promises to be the defining event of the cloud computing industry. Learn about the latest cloud technologies and platforms from thought leaders in Cloud Connect’s comprehensive conference.

Register Now!

More Events »

Subscribe to Newsletter

  • Keep up with all of the latest news and analysis on the fast-moving IT industry with Network Computing newsletters.
Sign Up


Learning Essential Command and Files: Listings

Listing 1. Sample output from some UNIX commands

A. The date command produces a formatted date/time string:

$ date
Sun Mar 20 08:15:48 MST 1988
$ []

B. Use the cal command to print a monthly calendar:

$ cal 12 1988
   December 1988
 S  M Tu  W Th  F  S
             1  2  3
 4  5  6  7  8  9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
$ []

C. The uname command tells you about your system hardware and software:

$ uname -a
UNIX omni SYSTEMS 3.51 mc68k
$ []

Listing 2. The command prints a listing of a directory

A. The standard System V ls command produces a single-column directory listing:

$ ls
07start.mm
07start.prn
listing1
listing2
listing3
listing4
outline save
$ []

On Berkeley UNIX, ls produces a multi-column listing when output goes to the screen.

B. A long directory listing shows file and directory detail:

$  ls -l
total 55
-rw-r--r--  1 arh   omni     9693 Mar 21 15:19 07start.mm
-rw-r--r--  1 arh   omni    11026 Mar 21 21:26 07start.prn
-rw-r--r--  1 arh   omni      536 Mar 21 21:07 listing1
-rw-r--r--  1 arh   omni      417 Mar 21 21:08 listing2
-rw-r--r--  1 arh   omni      965 Mar 21 21:23 listing3
-rw-r--r--  1 arh   omni      761 Mar 21 21;10 listing4
-rw-r--r--  1 arh   omni     2470 Mar 17 21:52 outline
drwxr-xr-x  2 arh   omni       48 Mar 15 14:03 save
$[]

Listing 3. Basic editing with Ed

A. Create a text file by appending lines:

$ ed sample.txt
?sample.txt
a
This is a sample file.  It is being created with the 
help of the ed text editor.
.
w
81
[]

B. View the lines you entered using the Ed print (p) command:

l,$p
This is a sample file.  It is being created with the 
help of the ed text editor.
[]

C. Terminate editing by typing the Ed quit (q) command:

q
$ []
Print This Page


e-mail Send as e-mail

Research and Reports

Hypervisor Derby
August 2011

Network Computing: August 2011

TechWeb Careers