IT��ά������������ҵ��ֵ��
�й�IT��ά����ҳ | ��Ѷ���� | ��ά���� | ��Ϣ��ȫ | CIO�ӽ� | �Ƽ��� | ��Ѱ��� | ��ά��Դ | ר��߻� | ֪ʶ�� | ��̳

Linuxϵͳ��������־�ļ��ͳ�������(3)

2008��07��15��
51CTO/

chyang pts/0 Aug 18 15:06
ynguo pts/2 Aug 18 15:32
ynguo pts/3 Aug 18 13:55
lewis pts/4 Aug 18 13:35
ynguo pts/7 Aug 18 14:12
ylou pts/8 Aug 18 14:15

���ָ����wtmp�ļ�������who�����ѯ������ǰ�ļ�¼������who /var/log/wtmp�������Դ�wtmp�ļ�������ɾ��������ÿһ�ε�¼��

��w����

w�����ѯutmp�ļ�����ʾ��ǰϵͳ��ÿ���û����������еĽ�����Ϣ�����磬����w���Ȼ�󰴻س���������ʾ�������ݣ�

3:36pm up 1 day, 22:34, 6 users, load average: 0.23, 0.29, 0.27
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
chyang pts/0 202.38.68.242 3:06pm 2:04 0.08s 0.04s -bash
ynguo pts/2 202.38.79.47 3:32pm 0.00s 0.14s 0.05 w
lewis pts/3 202.38.64.233 1:55pm 30:39 0.27s 0.22s -bash
lewis pts/4 202.38.64.233 1:35pm 6.00s 4.03s 0.01s sh /home/users/
ynguo pts/7 simba.nic.ustc.e 2:12pm 0.00s 0.47s 0.24s telnet mail
ylou pts/8 202.38.64.235 2:15pm 1:09m 0.10s 0.04s -bash

��users����

users�����õ�����һ�д�ӡ����ǰ��¼���û���ÿ����ʾ���û�����Ӧһ����¼�Ự�����һ���û��в�ֹһ����¼�Ự���������û�������ʾ��ͬ�Ĵ��������磬����users���Ȼ�󰴻س���������ʾ�������ݣ�

chyang lewis lewis ylou ynguo ynguo

��last����

last������������wtmp����ʾ�Դ��ļ���һ�δ���������¼�����û������磺

chyang pts/9 202.38.68.242 Tue Aug 1 08:34 - 11:23 (02:49)
cfan pts/6 202.38.64.224 Tue Aug 1 08:33 - 08:48 (00:14)
chyang pts/4 202.38.68.242 Tue Aug 1 08:32 - 12:13 (03:40)
lewis pts/3 202.38.64.233 Tue Aug 1 08:06 - 11:09 (03:03)
lewis pts/2 202.38.64.233 Tue Aug 1 07:56 - 11:09 (03:12)

���ָ�����û�����ôlastֻ������û��Ľ��ڻ�����磬����last ynguo���Ȼ�󰴻س���������ʾ�������ݣ�

ynguo pts/4 simba.nic.ustc.e Fri Aug 4 16:50 - 08:20 (15:30)
ynguo pts/4 simba.nic.ustc.e Thu Aug 3 23:55 - 04:40 (04:44)
ynguo pts/11 simba.nic.ustc.e Thu Aug 3 20:45 - 22:02 (01:16)
ynguo pts/0 simba.nic.ustc.e Thu Aug 3 03:17 - 05:42 (02:25)
ynguo pts/0 simba.nic.ustc.e Wed Aug 2 01:04 - 03:16 1+02:12)
ynguo pts/0 simba.nic.ustc.e Wed Aug 2 00:43 - 00:54 (00:11)
ynguo pts/9 simba.nic.ustc.e Thu Aug 1 20:30 - 21:26 (00:55)

��ac����

ac������ݵ�ǰ��/var/log/wtmp�ļ��еĵ�¼������˳��������û����ӵ�ʱ�䣨Сʱ���������ʹ�ñ�־���򱨸��ܵ�ʱ�䡣���磬����ac���Ȼ�󰴻س���������ʾ�������ݣ�

total 5177.47

����ac -d���Ȼ�󰴻س���������ʾÿ����ܵ�����ʱ�䣺

Aug 12 total 261.87
Aug 13 total 351.39
Aug 14 total 396.09
Aug 15 total 462.63
Aug 16 total 270.45
Aug 17 total 104.29
Today total 179.02

����ac -p���Ȼ�󰴻س���������ʾÿ���û����ܵ�����ʱ�䣺

ynguo 193.23
yucao 3.35
rong 133.40
hdai 10.52
zjzhu 52.87
zqzhou 13.14
liangliu 24.34
total 5178.24

��lastlog����

lastlog�ļ���ÿ�����û���¼ʱ����ѯ������ʹ��lastlog������ij�ض��û��ϴε�¼��ʱ�䣬����ʽ������ϴε�¼��־/var/log/lastlog�����ݡ�������UID������ʾ��¼�����˿ںţ�tty�����ϴε�¼ʱ�䡣���һ���û���δ��¼����lastlog��ʾ**Never logged**��ע����Ҫ��root�������и�������磺

���������뵽��http://bbs.cnitom.com

����Ķ�

ͼ���ȵ�

Linux������ʾ��Ϣ���
Linux������ʾ��Ϣ�������ؽ��������˺���Linux����Ϊ�������ij�����ʾ��Ϣ��ֱ������һ������������...
��;���� �����ʶ����ɫɫ��Linux
��;���� �����ʶ����ɫɫ��Linux�ڡ���;������linux.chinaitlab.com/administer/777741.html" target=_blank>��...

�����ȵ�