Posts Tagged ‘write’

Sending message to users logged into a unix terminal

Tuesday, March 11th, 2008

This is rather simple. Lets say you are logged into a unix/linux terminal that other people are logged into and you need to shoot a quick message to another user, or to all users.

First lets see who’s on the machine. We would use the “w” command. Simply type “w” without quotes into your terminal. You should receive an output similar to this:

10:54:24 up 9 days, 21:14, 4 users, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
user1 :0 - 02Mar08 ?xdm? 2:08 0.33s /usr/bin/gnome-
user1 pts/0 :0.0 03Mar08 8days 0.31s 0.31s bash
user1 pts/1 static-64-83-0-2 07:51 0.00s 0.27s 0.00s w
user2 pts/2 static-64-83-0-2 08:17 2:36 0.23s 0.23s -bash

user1 and user2 are just variables I created, that column will display the username. The TTY field tells you what terminal they are logged into. The From field will specify is they are logged on locally or from an ip address. You also are given idle time and what application they are using.

(more…)