write

Use the write command to send a quick message to another user. The syntax for write is as follows:

write username <terminal> 

For example, to send a message to bcalkins, I’ll type the following:

write bcalkins <cr> 

After pressing the Return key, the user will be alerted by an audible beep, and the message will be displayed on the system console or in the console window (if using CDE), as shown in Figure 5.2.

Figure 5.2. The console window.


As you type each line of text, the line of text will be sent to the recipient after every Return. When finished, press Ctrl+D.

Within CDE, the write command sends a message to the console window by default. If the user does not have the console window open, which many users do not, the message will not appear. Therefore, before sending the message, type the who command as follows:

who <cr> 

The following list of logged-in users is displayed:

bcalkins   console      Jun 26 13:54    (:0) 
bcalkins   pts/5        Jun 26 13:55    (:0.0) 
root       pts/2        Jun 26 11:17    (192.168.0.2:0.0) 
bcalkins   pts/6        Jun 26 13:56    (:0.0) 

Note

The who command is covered in Chapter 16, “System Security.”


The second column of information shows the name of each window the user has open on his desktop. You can send the message to a specific window by specifying the terminal argument after the username as follows:

write bcalkins pts/5 <cr> 

The message will pop up in the window labeled pts/5 on the user’s desktop. As a user, if you do not want to allow messages to be displayed in your window, use the mesg command described later in this section.

wall : rwall

The wall (write all) command is similar to the write command, but it is used to send an immediate message to all users currently logged in to the system. The syntax is as follows:

wall <cr> 

After pressing the Return key, you can start typing your message on the blank line. No prompt is given. After typing your message, press Return to get to an empty line and then press Ctrl+D to send the message. Each logged-in user will be alerted by an audible beep, and the message will be displayed on the system console or in the console window if using a windowing system.

The –a option can be used to broadcast to the console as well as the window pseudo terminals. When using the –a option, the message will get sent to all open windows, not just the console window. As a user, if you do not want to allow messages to be displayed in your window, use the mesg command described later in this section.

The rwall command is just like the wall command except it can be used to write messages to logged-in users on remote systems. The syntax is as follows:

rwall <hostname>  <cr> 

To send a message to all logged-in users on a remote host named ultra1, type the following:

rwall ultra1 <cr> 

Follow the instructions for the wall command to type and send the message.

talk

talk is a two-way, screen-oriented messaging program that enables both parties to carry on a live chat session. A user on one host invokes the session by typing the following:

talk <username>@<hostname>  <terminal> 

To talk to someone on your own system, <username> is the person’s login name. If you want to talk to a user on another host, <username> is one of the following forms:

hostname!username 
hostname.username 
hostname:username 
username@hostname 

If the recipient is logged in more than once, the <terminal> can be specified to indicate the terminal name on which you want to chat.

The other party will receive a notice on his terminal that looks like this:

Message from TalkDaemon@ <hostname> at <time> 
talk: connection requested by <your_address> 
talk: respond with: talk <your_address> 

Respond with the following to complete the connection and establish a “chat” session:

talk <username>@<hostname> 

Each user will see a split screen where he can simultaneously receive and send messages with the other user. When done chatting, press Ctrl+C or Ctrl+D to terminate the session.

mesg

If you do not want to be interrupted with messages, you can block messages from being sent to your terminal via write, talk, and wall by using the mesg command. To block messages, type the following:

mesg n <cr> 

Now all users (except root) will get the following message when trying to send a message to your terminal:

Permission Denied 

To allow messages, type the following:

mesg y <cr> 

Type mesg with no options to see the current state of messaging in that terminal window. In CDE, each window is treated as a terminal. Therefore, you’ll need to issue the mesg command in each window.

The mesg command will not stop messages from being displayed in the console window. If you do not want messages displayed in the console, close the console window.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset