Chapter 13

UNIX is a very powerful multi-user, multitasking operating system. Unlike DOS, UNIX is case sensitive. If any part of the command or argument is entered in the wrong case, e.g., upper case instead of lower case, the command will either not be accepted, or it will be executed incorrectly. Presently, most of the Internet servers in the world operate using UNIX. UNIX has a built-in networking capability which permits it to be used as the operating environment of many multi-user systems. Most of the Internet providers around the world furnish a full UNIX "shell" to their clients. A shell is a DOS-like command interpreter which can execute commands and thereby, run applications. There are a great number of commands available under UNIX. For security reasons, however, VSNL provides only a limited subset of these commands for their Terminal account users. The UNIX prompt in our case is:

username> ,

where "username" is your personal username given to you by VSNL; for example, in my case it is "rajm".

In this chapter, the symbol <cr> stands for the Return, <Enter>, or Carriage Return key, depending on the terminology of your particular computer keyboard.

You will notice that all the services on the First Menu have equivalent commands, and in fact, each can be executed directly from the UNIX prompt, in the absence of the Menu. Below we will explore the most useful commands in some detail. If you wish to familiarize yourself with the many other UNIX commands, you should get a reference book or textbook for that purpose. Many excellent ones have been published. VSNL supplies no online manual or online help for the UNIX command set.

13.1 Pine

Pine is the mailer available at VSNL for Terminal accounts. In fact if you type


at the UNIX prompt you will be presented with the same screen you would see by choosing option "1" from the First Menu, i.e., the E-mail option. E-mail has been covered in detail in Chapter 4.

13.2 ftp

Ftp stands for "file transfer protocol" and it is item "2" of the First Menu. If you type ftp<cr> at the prompt you will get the same result as selecting "2" of the First Menu. This is dealt with in great detail in Chapter 5.

13.3 telnet

Telnet is the service which allows one to log on to remote computers. It is also item "3" on the First Menu. If you type telnet<cr>at the prompt you will get the same screen as if you picked item "3" from the First Menu. Telnet service has been explained in detail in Chapter 6.

13.4 lynx

Lynx is the WWW text-only browser. It can be invoked from the UNIX prompt by typing lynx<cr>. You will see the same screen as if you picked "4" from the First Menu. Use of this browser for searching information is given in detail in Chapter 7.


13.5 irc

IRC is an acronym for "Inter Relay Chat." It is available as item "5" of the First Menu. If you type irc<cr> at the prompt you will enter the same program as if you picked it from the First Menu. Again this is discussed in detail in Chapter 8. Please note that there is an "ii" command also available which is the same as "irc."

13.6 kermit

If you type kermit<cr> at the prompt, the prompt, itself, will change. The new prompt will be "C-Kermit", which is the same result you would get if you selected item "6" from the First Menu. For details, see Chapter 9. A command "km" also invokes kermit at the UNIX prompt.

13.7 passwd

Typing passwd<cr> at the UNIX prompt will allow you to change the password as if you had selected item "7" from the menu. This again has been discussed in some detail in Chapter-10.

13.8 sz & rz

Syntax: sz filename<cr> or rz filename<cr>

These commands accompanied by the name of a file (the command argument) are used to begin a file transfer sent from VSNL (sz) to your computer, or received by VSNL from your computer (rz). They initiate the Zmodem file transfer protocol. Zmodem is a very sophisticated file transfer method. It assures that the file is transferred from one computer to another intact, without any errors, and at the maximum speed possible. Should the modem connection be interrupted during file downloading (from VSNL) or file uploading (to VSNL), Zmodem notes the point where interruption occurred, and, when the connection is restored, it will take up the transfer where it left off -- quite a nice feature if a very large file is involved.

Obtaining a file from an Internet source, such as a website, involves two transfers. First, the file is transferred to your VSNL host computer or server, and then the file can be transferred from VSNL to your personal computer. The E-mail export option, for a received E-mail message, can be used to save a file in your account at VSNL, on VSNL's disc. Then, in order to obtain a copy of that file for your computer, at the VSNL UNIX prompt, type:

sz filename<cr>.

If you are using Telix or Procomm Plus, VSNL will respond to the command by initiating your computer's Zmodem program, and it will participate with VSNL to automatically transfer the file from the VSNL server to your computer's "download" directory. If the files you are transferring from VSNL have some common pattern, you can use wild cards, e.g., *.doc ("*" in a file name means, "anything") to transfer the batch of files.

To copy a file from your computer to VSNL's server, at the VSNL UNIX prompt, type:

rz filename<cr> [filename is the name you wish your file to have at VSNL, not necessarily the same as on your computer.]

Then on your computer, invoke the Zmodem upload, which in the case of Telix and Procomm Plus is assigned to the PgUp key. Next, select the Zmodem protocol, and enter the exact name of the file stored on your computer that you wish to send to VSNL. This will start the file transfer from your computer to VSNL. The system will return to the UNIX command prompt when the process is complete.

Usually you will need to use the "rz" command in cases where you want to compose mail offline or attach a text or binary file to your e-mail message in the Pine Mailer. This has been discussed in Chapter 4.

The commands discussed above, except rz, are all available via the First Menu. In what follows, we shall elaborate on some other commands which are useful.

13.9 menu

Issuing the menu command at the prompt will bring up the First Menu. I suggest you practice using UNIX commands at the prompt instead of using the Menu system; the "command" method is faster and more versatile.

13.10 ls

The UNIX command "ls<cr>" puts a listing of the files in the current directory of your account (on VSNL's disc), on the screen of your monitor. For VSNL's GIAS account users, the "current directory" happens to be the home directory. This command, ls, has many switches (options), and they are utilized by adding them to the command with a hyphen. For example,

ls -l<cr>

gives you a listing of the files in your account with full details, e.g., ownership of the file, the size and other information.

One other switch which is of interest is "-a" to show all the files including hidden files.

13.11 rm

The command "rm" is used to delete files from your home directory. It should be used with some caution as UNIX does not warn you which files it is deleting, especially if you use wild card such as "*" or "?". You may end up deleting files you don't want to lose. If you use this command with switch "-i" it will delete the files interactively, i.e., after first asking you if you want to delete given file, one at a time.

The command synonym, "mrr" is the same as the "rm" command.

13.12 mail

The command "mail" at the prompt will invoke UNIX mail. It will allow you to read the mail. This is a somewhat user-unfriendly mail program, and you are better off to stick to "Pine" as "mail" does not offer as much functionality and ease of use as Pine.

13.13 cat

If you have a text file sitting in your account, and you want to see the contents of it, use the "cat" command. It is very similar to DOS's "type" command. The command syntax is:

cat filename<cr>

13.14 more

Suppose you try to see a listing of your directory in long form by issuing the command, "ls -l<cr>" and you have more then 25 files in your home directory. Then the listing will flash past your screen. To be able to see a screen-by-screen listing you can use the "more" command. This command is most commonly used with "ls" or "cat" commands. The syntax for the usage is:

ls -al |more<cr> (Note the use of the switches, "a" and "l".)

cat filename |more<cr> .

The symbol "|" which is used to separate the first command from the second command "more", as shown above, is sometimes called a "pipe". The procedure where one command is passed through another command, as above, is called "piping."

13.15 tail

Suppose you wanted to see only 10 lines of the text of a file sitting in your account at VSNL. You can use the "tail" command to view it. The command syntax is:

tail filename<cr>

In context of the Internet, the "tail" command has limited usage.

13.16 pico

Many text editors have been developed for UNIX, starting with the line editor "ed." The full-screen editors include emacs, vi, and most recently, pico. Pico is the easiest to use of all these editors. However it is less versatile than either emacs or vi. Pico is the editor called by Pine below the "--- message text ---" line, for composing an e-mail message. The correct syntax for editing a file with pico, directly from the UNIX prompt, is:

pico filename<cr>

You can either edit a file or compose a new file. When you invoke this editor you will see a screen somewhat like what you seen in e-mail, as shown in Fig 13-1:

Fig.13-1 Pico editor screen

UW PICO(tm) 2.5 File: chinese2.htm#sfwt



See How to Get Unlimited Internet Access for $15/month Flat Rate!


Bean Curd Dip

^G Get Help ^O WriteOut ^R Read File ^Y Prev Pg ^K Cut Text ^C Cur Pos

Exit ^J Justify ^W Where is ^V Next Pg ^U UnCut Text^T To Spell


Here, a file chinese2.htm#sfwt has been opened in pico for editing as shown at the top of the screen. Please note that all the common commands useful with pico are given at the bottom of the screen.

To exit the editor, type "^x", which gives you the screen shown in Fig.13-2:

Fig.13-2 Response to ^x command, to exit from pico

UW PICO(tm) 2.5 File: chinese2.htm#sfwt Modified


(Return to Recipe Index)


See How to Get Unlimited Internet Access for $15/month Flat Rate!


Bean Curd Dip

Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ? Y Yes ^C Cancel N No

Here pico asks if you want to save the changes. If you answer "No" by pressing "n" pico will exit without saving the changes. If you say "yes" it will ask for the name of the file to save to. The default filename for saving is the original file you started editing.

If you need more help press "^g" and it will display pico help, which is shown in Fig. 13-3, below:

Fig. 13-3 Pico Help screen

Pico Help Text

Pico is designed to be a simple, easy-to-use text editor with a
layout very similar to the pine mailer. The status line at the top of the display shows pico's version, the current file being edited and whether or not there are outstanding modifications that have not been saved. The third line from the bottom is used to report informational messages and for additional command input. The bottom two lines list the available editing commands.

Each character typed is automatically inserted into the buffer
at the current cursor position. Editing commands and cursor movement (besides arrow keys) are given to pico by typing special control-key sequences. A caret, '^', is used to denote the control key, sometimes marked "CTRL", so the CTRL-q key combination is written as ^Q.

The following functions are available in Pico (where applicable,
corresponding function key commands are in parentheses).

^G (F1) Display this help text.
^F move Forward a character.
^B move Backward a character.
^P move to the Previous line.
^N move to the Next line.
^A move to the beginning of the current line.
^E move to the End of the current line.
^V (F8) move forward a page of text.
^Y (F7) move backward a page of text.
^W (F6) Search for (where is) text, neglecting case.
^L Refresh the display.
^D Delete the character at the cursor position.
^^ Mark cursor position as beginning of selected text.
^D Delete the character at the cursor position.
^^ Mark cursor position as beginning of selected text.
Note: Setting mark when already set unselects text.

^K (F9) Cut selected text (displayed in inverse characters).

Note: The selected text's boundary on the cursor side
ends at the left edge of the cursor. So, with selected text to the left of the cursor, the character under the cursor is not selected.

^U (F10) Uncut (paste) last cut text inserting it at the
current cursor position.
^I Insert a tab at
the current cursor position.
^J (F4) Format (justify) the current paragraph.

Note: paragraphs delimited by blank lines or

^T (F12) To invoke the spelling checker
^C (F11) Report current cursor position
^R (F5) Insert an external file at the current cursor position.
^O (F3) Output the current buffer to a file, saving it.
^X (F2) Exit pico, saving buffer.


Top of the Chapter
Table of Contents