last(1) General Commands Manual last(1)Name
last - indicate last logins of users and teletypes
Syntax
last [-N] [name...] [tty...]
Description
The command looks back in the file, which records all logins and logouts, for information about a user, a teletype or any group of users
and teletypes. Arguments specify names of users or teletypes of interest. Names of teletypes can be given fully or abbreviated. For
example `last 0' is the same as `last tty0'.
If multiple arguments are given, the information that applies to any of the arguments is printed. For example, `last root console' lists
all of "root's" sessions as well as all sessions on the console terminal.
The command prints the sessions of the specified users and teletypes, most recent first, indicating the times at which the session began,
the duration of the session, and the teletype on which the session took place. If the session is ongoing or was cut short by a reboot,
indicates that this is so.
The pseudo-user reboot logs in at reboots of the system. Therefore, the following example gives an indication of mean time between reboot:
last reboot
The command with no arguments prints a record of all logins and logouts, in reverse order.
If is interrupted, it indicates how far the search has progressed in If interrupted with a quit signal (generated by a <CTRL/E>) indicates
how far the search has progressed so far, and the search continues.
Options-N Limits the number of output lines to the specified number.
Files
/usr/adm/wtmp
login data base
/usr/adm/shutdownlog
records that shutdowns occurred and why
See Alsowtmp(5), ac(8), lastcomm(1)last(1)
Check Out this Related Man Page
LAST(1) BSD General Commands Manual LAST(1)NAME
last -- indicate last logins of users and ttys
SYNOPSIS
last [-n] [-h host] [-t tty] [user ...]
DESCRIPTION
Last will list the sessions of specified users, ttys, and hosts, in reverse time order. Each line of output contains the user name, the tty
from which the session was conducted, any hostname, the start and stop times for the session, and the duration of the session. If the ses-
sion is still continuing or was cut short by a crash or shutdown, last will so indicate.
-n Limits the report to n lines.
-h host Host names may be names or internet numbers.
-t tty Specify the tty. Tty names may be given fully or abbreviated, for example, ``last -t 03'' is equivalent to ``last -t tty03''.
If multiple arguments are given, the information which applies to any of the arguments is printed, e.g., ``last root -t console'' would list
all of ``root's'' sessions as well as all sessions on the console terminal. If no users, hostnames or terminals are specified, last prints a
record of all logins and logouts.
The pseudo-user reboot logs in at reboots of the system, thus ``last reboot'' will give an indication of mean time between reboot.
If last is interrupted, it indicates to what date the search has progressed. If interrupted with a quit signal last indicates how far the
search has progressed and then continues.
SEE ALSO lastcomm(1), utmpx(5), ac(8)HISTORY
Last appeared in 3.0BSD.
4th Berkeley Distribution June 6, 1993 4th Berkeley Distribution
Hi There,
I have a cron script that returns the error:
syntax error on line 1, teletype
Has any one seen this, know what it is, or know's how to get rid of it?
Thanks,
Jeremy. (1 Reply)
I want a script that checks the logins and logouts in a system.Is there a way to keep the logins and logouts in files and then compare them every e.g. 10 seconds?
for tcsh. (1 Reply)
Hi everyone hope you can help me
i have 5 root users and the problem with that is how can you see
witch root user did what on the box how can you track the users that
played on the servers.
1) What commands they typed (in linux you get history )
2) From witch ip did they connect to the server (3 Replies)
I want to apply patches in multiuser mode but stop logins of other users while I do it?
What is the best way to do this?
I will be connected to the system via a putty session over a serial cable from another system (console is messed up)...
Should I put in a dummy passwd and shadow file... (7 Replies)
I have a file that logs multiple sessions. What I would like to do is split this file inclusive of the lines that include "starting session" and "shutting down" and ignore the data before and after the beginning of the first session and the end of the last session. The output files can be called... (2 Replies)
Dear Forum,
I had this case before, all of sudden all users including root can't login. What done is by connecting to console port and resetting root password, "pwunconv" command, reboot server.
My question is, how this can happen???
thanks
:confused: (3 Replies)
I have a file split something like
01/11/2010:
No of users 100
02/11/2010:
No of users 102
03/11/2010:
No of users 99
...
I want to search the file for a particular date and then extract the following line with the date, something like
02/11/2010 No of users 102
I can grep... (6 Replies)
I have a need to take the output of the who command and first strip out users with only 1 session, then of the remaining users I need only to list the ones who are using more than 1 IP address
Normal output:
tander01 pts/113 Feb 11 09:21 (10.25.1.23)
tbanks pts/81 ... (4 Replies)
Hii All
I was building two M4000 servers and one was successfully installed.
Other one /usr has been unmounted. my putty session got disconnected and i connected to console where it asked for root single maintence
#
# init 0
not foung
# df -h
not found
#
xscf>poweroff -a
xscf>... (8 Replies)
I have disabled rlogin for root successfully , but after that i could not login to root from console and could not su to root from other users as it responded as expired account
I did not have any admin user but I have managed to recover the situation by accessing rootvg before mounting it, but... (5 Replies)
will reboot -- -r update boot_archive ?
this is the what I see on my console.
# reboot -- -r
15+0 records in
15+0 records out
syncing file systems... done
It doesn't say updating /platform/sun4u/boot_archive as it displayed on my console after init 0or init 6 ? (3 Replies)
Hi guys,
thanks for your kind assistance. I have a rhel6.4 server. After I did an update, the server does not reboot. Also user logins take for ever.
Please any help on this matter will be appreciated .
Thank you (2 Replies)
Hi
The telnet sessions stay as idle users. It is not getting kicked out.
Please advise what could be the issue. only when we reboot the server these telnet sessions goes.
Below is the current output from the server. we rebooted the server three days ago:
pmut6:/> uptime
04:21PM... (8 Replies)