PDA

View Full Version : Quick commands to find out user info.


ghenry
27th April 2004, 10:46 PM
I thought I would share some of my commonly used commands for finding out user information:

who Shows a listing of currently logged-in users. This command reads /var/log/utmp.
w Shows who is logged on and what they are doing.
last Shows a list of last logged-in users, including login time, logout time etc. This command reads /var/log/wtmp.
lastb Same as last, except that by default it shows a log of the file /var/log/btmp, which contains all the bad login attempts.
lastlog This command reports data maintained in /var/log/lastlog, which is a record of the last time a user logged in.
ac Prints out the connect time in hours on a per-user basis or daily basis etc. This command reads /var/log/wtmp.
dump-utmp Converts the raw data from /var/run/utmp or /var/log/wtmp into ASCII-parsable format.
ftpwho The ftpwho program utility displays all active ftp users, and their current process information on the system.
The output of the command is in the format of the "/bin/ps" command.
ftpcount The ftpcount program utility, a simplified version of ftpwho, shows only the current number of users logged in to
the system, and the maximum number of users allowed.


Please add more.

Bana
4th May 2004, 01:37 AM
Does anyone know the commands to send messages to other logged in users? I have heard something about this but don't know which ones to use.

LordMorgul
4th May 2004, 03:48 AM

The 'talk' program and similar should allow direct chatting between users, but I think what you are referring to (and what I use most often) is 'write'.

write billybob pts/11
typing a message until I push ctrl-c

Message is sent directly to the user's terminal. This can be disallowed by the user with the mesg command... root however might not obey, I'm not sure.

ghenry
4th May 2004, 08:47 AM
I think the one you mean is wall:

NAME
wall -- send a message to everybody’s terminal.

SYNOPSIS
wall [-n] [ message ]

DESCRIPTION
Wall sends a message to everybody logged in with their mesg(1) permis-
sion set to yes. The message can be given as an argument to wall, or
it can be sent to wall’s standard input. When using the standard input
from a terminal, the message should be terminated with the EOF key
(usually Control-D).

The length of the message is limited to 20 lines. For every invocation
of wall a notification will be written to syslog, with facility
LOG_USER and level LOG_INFO.

ghaefb
4th May 2004, 09:08 AM
What about finger and id (whoami) ... :p

ghenry
4th May 2004, 11:30 AM
Not many people fun finger servers anymore, but yeah, if you need to find out someones uid, then id is the one.