In the early days it was common for many people to work in one machine, often at the same time. Naturally ideas like messaging, chat, mail, etc. were part of Unix right from the beginning. This week’s unit you will get to know those original tools for viewing users logged on at a specific time, write and talk to them get information on users who are off-line and finally how to e-mail in the command line.
Let’s see what manual pages exist related to ’who’:
The commands who (who is logged in), w (what they are doing) and whoami are interesting for us:
As you can see in the example above, who -H prints headers to the columns. who am i is a special version of who showing details of one’s own session. The output of w above shows that two users are logged in remotely, user1 has two sessions open.
The command last (last logged in) lists the users logged in last.
The user ’reboot’ is a special kind of a user. It shows that the local time is 17:56 and the machine has been running since 09:13 the same day.
The command finger gives you some information of other users, in the system: .
This information is called GECOS (General Electric Comprehensive Operating System) in Unix. It is a term originated in a now extinct operating system. Some information like the phone number can be can be set by the user. The command is chfn (change user name and information). In the practice computer only the super user can change the user names, but you can set other values.
Excercise: Add (hypothetical) home and office phone numbers and a room number to your GECOS.
You will leave additional information like vacation notices or about your current work. See for example:
The trick is to create special files like .project and .plan in your home directory. Since we haven’t done file editing yet, you can create those files through the following hack:
If you are working in a multi-user Unix system, you are bound to see messages like Message from userX pts/2 ... accompanied by a beep tone. UserX wants to write to you, to respond you start write giving the login name (and the terminal, if userX is logged in more than one).
The write program imposes no rules, doesn’t have a protocol except that pressing Return sends complete lines to the other side. The convention is to take turns, ending turn with (o), which stands for “over”, and to signal your intent to quit with (oo), for “over and out”. Finally, Ctrl-d ends the connection.
The following screen artificially seperates the messages of the two partners:
If you don’t want to be bothered with such messages, refer mesg.
talk is what is today known as “chat”. In the example below userX starts a conversation by typing talk userY@localhost. Then userY responds as requested, that will join them in a full screen chat setup.
The system provides a postal system for communicating with other users. You must have noticed the message about mail as you logged in. You might even get notices of newly arriaved mail.
To read your mail, open your mail client, often simply called mail. An overview of your mails, called mail headers, will be printed. To read a the current message, just type ’p’ (print), or to read a specific message type ’p msg.no’. ’h’ (headers) gives you the listing of headers. ’s filename’ (save) will save a message in a file. ’d’ deletes messages, and ’q’ quits the program.
Sending mail to someone is straightforward:
The Ctrl-d signals the EOT (end of text).
For practice, send mails to yourself. (It is not as odd as it may sound - it’s a handy way of taking notes.)
There are other ways of sending mail – you can send a previously prepared letter, you can mail to a number of people all at once, and you may be even able to send mail to people on other machines. In this week’s assignment you will learn more about these things.
Note that the simple mail program we have in the Raspberry is a full featured with a rich set of encryption like SMIME, SSL, SMTP-Auth, etc. Which are beyond this course. Here you can demonstrate that the common “signature” attachment works by creating a file called .signature (note the dot as the first character) in your home directory.
The original calendar program cal is ‘read only”, you can not enter your appointments in to it. Such a calendar program is included in the Raspberry, called pal.
See how you could maintain your appointments in pal. This is only for the freaks. ;)
There are two time slots reserved for the assignment: see the on-line platform for details.
This assignment is fun, only if there are many users logged in at the same time. So, be there! This assignment is open to all who have collected their account in assignment 1, irrespective whether you passed the other assignments.
Please note that, you might need some “training” before the fun begins. So do a rehearsal before the session.
During the assignment you will be collecting the data to be submitted in a text file and will mail the file to user e00000. To do that you need to know few things which we haven’t covered yet. Here they are, without explanations:
At this time, just use a one-word subject!
Except otherwise stated, add the outputs of the steps below to a file called ’evidence’:
Step 1: Print the system date.
Step 2: Print ’who am i’.
Step 3: Record the ’who’ and ’what’ of the others who are logged in.
Step 4: Get the last 5 logins in to the system
Step 5: Find out when the system was last rebooted
Step 6: Create your own .project file
Step 7. Finger a couple of users and record one with a .project file.
Step 8: Send a couple of ’write’ messages to others. (This one you can not record)
Step 9: ’talk’ with sombody. (This too you can not record)
Step 10: Read your mail. There will be a mail from e00000. Reply to it! (If you delete the message by mistake, you can just write a new mail.)
Step 11: Mail the your recording of steps 1 - 7 to e00000.
Addition: You need to ”submit” in the assignment tool with a short note like ”I have sent the mail to e00000”, as explained the Announcement forum.
In this week you’ve learnt: