Communication in UNIX

Posted by Amrita Gautam at July 18, 2021

INTRODUCTION

The strongest feature of UNIX is self-networking or communication. Today most of the companies still prefer UNIX because of this feature. Communication is a facility through which user can send and receive messages and data from one user to another. There are two type of communication is possible in UNIX:  Remote communication as well as local communication.

This chapter will introduce you to the concept of communication in UNIX, type of communication, online communication, offline communication, commands related with communication and at last concept of UUCP

8.1   COMMUNICATION IN UNIX

In any kind of Multi-user Operating System, it is often necessary for users to know about each other, when there is of hundreds of user working in the network who are fat apart then electronic communication is the only way to share data and messages. There can be two king of communication in UNIX:

  1. Remote Communication
  2. Local Communication

8.1.1   Remote Communication

Remote communication is facility provided by UNIX through which any user who is working in some other platform and network can connect with UNIX server by simply using server address. There are some utilities like telnet and rlogin, which lets you, login to the System remotely. Telnet is used most often. There are telnet clients available for nearly any platform, though usually UNIX System are the only ones running a telnet server. Telneting into a UNIX machine will allow you to use a command line shell, including full screen display programs if your terminal is set up properly. Rlogin (short for Remote-LOGIN) looks similar to telnet on the surface, but uses a different set of protocols. More information is exchanged between the client and server during an rlogin session than during a telnet session. This gives it more functionality, but also creates some security risky if not used carefully. One of the main features of rlogin is the. hosts file. This is a file that a user can have in his or her home directory that lists a set of machines and usernames that are to be considered “trusted”. This allow the user to login to one of the trusted machines, and then rlogin into the main machine without supplying a password. I’m sure it’s obvious at this point why hosts files should be used with care. Besides rlogin, there is a whole suite of remote applications including RCP (remote copy), RCP (remote shell) and rexes (remote execute) that rely on the. hosts file to determine trusted users and machine. Telnet and login are both executed from the command line, with the remote host address as an argument.

This topic cannot be covered in detail because it is not in the scope of this book.

8.1.2    Local Communication

All the users who are working in UNIX environment can share their data communication. Communication can be divided into two categories:      

  •  On-line communication
  • Off-line communication
  • On-Line communication:  These commands allow a use to send a message to another user logged into the same network at the same time. This is thus a means of on line communication because the recipient obtains the message immediately. In on-line communication commands message displays on the screen of the receiver by interrupting the work of receiver. It can be very annoying to receive a message which clusters up your screen while you are concentrating on same other important work.
  • Write: Two-way communication: This commands provides you facility for a two-way communication with any person who is currently logged in. A user sends a message and waits for the reply from other user.

Syntax: write <username>

Example:

$ write dit

 Type the name of the user to whom you want to send a message, type command and then press < ctrl+d > or oo <over and out> when you want to terminate the message.

At the receiver end message will be displayed as follows:

Through write user can also send message which is stored in a file.

Example:

Send test file data to used dit

$ write dit <test

At receiver end

  •  Message : permission to talk :    In two ways on-line communication as we have already discussed that message will be displayed on the receiver screen by interrupting current task. User can prevent such intrusions by using this command.

It has two options:

Pass n-if you do want to receiver on-line messages.

Pass y-if you want to receiver messages.

Syntax: message <option>

Example:

$ message n

To check whether message permission in on or not

$ message

Is y

  •   Talk: two-way communication : talk is a visual communication program which copies lines from your terminal to that of another user. If you wish to talk a particular user in your network then type his user name or login mane with talk or if you wish to talk to user who is working in same login then type terminal number.

It is same as write command but more convenient in comparison to write and superior also for two reasons:

  • It splits screen into two parts, one for receiving message and other for sending messages.
  • It runs on TCP/IP network

Example:

$ talk dit

  •    Wall : Write to all :  

Wall is a UNIX command line utility. When invoked, it displays the contents of a file or standard input to all logged-in users. Its name is an abbreviation of “write to all”.

It is generally used by the administrator to send important messages or notification at the time of shutdown.

Example:

# wall “this is test message”

The message will be displayed on everyone’s screen who is logged in.

(b).   Off-Line Communication:     In this kind of communication users can send or receive message when receive is not working. But through this user will not be able to talk or chat. The message will be stored at the receiver’s terminal and receiver can decide that whether he wants to look at the message or not. This communication is like the today’ E-mailing. There are following commands in UNIX that can be used for off-line communication.

1.   news command:    This command is normally used by any used user read any message that is send by the System administrator. It shows the contents which are stored in a file/user/news.

When user invokes this command he can see the contents of this file.

$news

Output:

News (root)

  •    Mail command:      This is off-line message command. User can receive messages when they are not logged in. The message will be stored in their mail box, and whenever they will log into the System, they will get message “you have mail” and they can check messages in their mail box.

With mail user can do several things, few of them are as follows:

  • View messages
  • Save messages
  • Delete messages
  • Reply for messages, etc.

Sending mail:     To send a mail to a particular user, sender needs to type mail command with user name to which he wants to send a message.

Syntax: $mail <user login name>

Example:

$mail dit

<ctrl d> key is used to end mail message.

Receiving mail:     Now whenever dit user will log into the System he will get a message after login i.e. “You have mail”

Now he can check his mail box by typing command mail at the command prompt. His mail box will be open.

Example:

$mail

There are same internal commands that can be used to work inside the mail box.

  1. Read mail:    this is used to read a particular mail type number of the mail you want to read at the mail prompt.
  2. Reply to mail:    This is used to reply a particular mail type r and number of the mail for which you want to reply, at the mail prompt. Or just type r, it will send reply to last real message user.

&r2

Or

&r

  • Delete mail:    To delete a particular mail from mail box type d and message number, or just typed , it will delete last read mail from mail box.

&d        or      &d2

  • Save mails into a file:    To save a particular mail or number of mails into a file, type w and message number with file name or type w and file name. The last read message will be saved into the file and will be removed from mail box. File will be created in the current directory of the user.
  • Quit from mail box:     To exit from the mail box type q and you will come to shell prompt ($).


Comments

Write a Reply or Comment