By Graham K. Rogers
Ever since the first Macs appeared, they have been known for the graphical user interface (GUI): icons instead of command line work which before the mid-1980s was the norm. Paradoxically, the arrival of OS X brought with it easy access to the command line should users ever want this, although it is possible to use the computer without ever needing to work at the command line at all.
Some simple commands have variations that can be useful both on a system and in the wider environment of the Internet. One basic question that can be posed using the Terminal is who
The answer will be the name of any logged in users, the date and time of last login, the hostname and (showing the ancestry of Unix) the TTY name (teletype).
To demonstrate this, I logged into the Admin account of my office iMac and then switched back to the user account, so I was logged into both.
Using the who command, I am told that I logged into Admin last on 19 September at the login screen (Console) and the user account (Graham) on 3 September. I am currently using the teletype name TTYs000 and have been since 12 September (I rarely log out). This is a reference to the computer terminal (remember that on mainframe systems there would be one central computer and a number of terminals). I can confirm that by typing tty at the command line which gives the same result.
I can take this a little further with the (perhaps philosophical) question, Who am I? Although Unix prefers this in the form, whoami. The answer is of course Graham as that is the name of the account in which I am working and would be the same if a friend posed the same question working at my computer.
The whois command is much more useful these days and can also be found in Apple's Network Utility (in Applications>Utilities) on a Mac with OS X. With it we can look up information about a server on the internet. For example
whois extensions.in.th
will display information about my host service and my registered address. Some servers (e.g. Apple.com) may not work with this command-line method as they may be hidden, but using the IP number will produce a result (Apple has all numbers in the 17.n.n.n range).
To be continued. . . .
See Also -
New Users and Terminal (1) -- A Quick Look Round
New Users and Terminal (2) -- Basic Navigation
New Users and Terminal (3) -- Shell Basics
New Users and Terminal (4) -- Lists and Manuals
New Users and Terminal (5) -- Internet Use
New Users and Terminal (7) -- A Little More Discovery
New Users and Terminal (8) -- File Commands and More
New Users and Terminal (9) -- Process Identification and Termination
New Users and Terminal (10) -- Browsing the Web using Unix
New Users and Terminal (11) -- Unix Tricks from OS X Daily
New Users and Terminal (12) -- Installed Text Editors - emacs, nano, pico, vi and vim
New Users and Terminal (13) -- Installing and Using the Utility, WGET
New Users and Terminal (14) -- Passwords, Purging and Closing Notes
New Users and Terminal (15) -- Permissions and chmod
Graham K. Rogers teaches at the Faculty of Engineering, Mahidol University in Thailand. He wrote in the Bangkok Post, Database supplement on IT subjects. For the last seven years of Database he wrote a column on Apple and Macs.
|