Last login with year


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Last login with year
# 1  
Old 01-26-2012
Last login with year

'last' command gives me date and time the user has logged in last. But how to get the date with year?
# 2  
Old 01-26-2012
last command reads from wtmp.. you sure that wtmp is since the last year?
This User Gave Thanks to aksijain For This Post:
# 3  
Old 01-26-2012
How old is your oldest /var/log/wtmp* file, I doubt that this is the issue you think it is (you could test with a wtmp > 12months old of course.
This User Gave Thanks to Skrynesaver For This Post:
# 4  
Old 01-26-2012
If you did a little search in the forums, you would have found e.g.

https://www.unix.com/shell-programmin...ast-login.html
This User Gave Thanks to vbe For This Post:
# 5  
Old 01-26-2012
There is no file starting with wtm in /var/log.

There is a file /var/adm/wtmpx. It is dated today. I am working in SUN-OS
# 6  
Old 01-26-2012
Yes.. that is the file Soham, last reads from that file /var/adm/wtmpx.

Since it does not have data of last one year. You cannot view it with last command.
It nullifies after every reboot.
This User Gave Thanks to aksijain For This Post:
# 7  
Old 01-26-2012
Sun solaris 10:
Code:
-rw-r--r--   1 root     bin        20460 Jan 26 13:45 utmpx
-rw-r--r--   1 adm      adm       400644 Jan 26 13:45 wtmpx
lo4:/var/adm $ uname -r
5.10

Now where is fwtmp on your system? Use the man pages!!
here:
Code:
 lo4:/var/adm $ cat utmpx| /usr/lib/acct/fwtmp|more
                                      system down                              0 10 0000 0000 1294737889 0 0 0  Tue Jan 11 10:24:49 2011
                                      system boot                              0  2 0000 0000 1294737892 0 0 0  Tue Jan 11 10:24:52 2011
                                      run-level 3                              0  1 0063 0123 1294737902 0 0 0  Tue Jan 11 10:25:02 2011
zsmon                            PM10                                      29117  6 0000 0000 1294737903 0 0 0  Tue Jan 11 10:25:03 2011
LOGIN                            co10 console                              29134  6 0000 0000 1294737904 0 0 0  Tue Jan 11 10:25:04 2011
root                             z100 pts/10                               29386  8 0000 0000 1310994824 0 0 12 zone:global Mon Jul 18 15:13:44 2011
vbe                              ts/7 pts/7                                21139  8 0000 0000 1321018426 375121 0 0  Fri Nov 11 14:33:46 2011
vbe                              ts/5 pts/5                                10365  7 0000 0000 1326815872 64734 0 22 ant Tue Jan  17 16:57:52 2012
vbe                              7    pts/7                                27482  8 0000 0000 1308149837 193568 0 1  Wed Jun 15 16:57:17 2011
vbe                              ts/8 pts/8                                12121  8 0000 0000 1321018426 372029 0 0  Fri Nov 11 14:33:46 2011
.
.
.

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Can adding to a new group be effective in current login environment without re-login?

Hey folks, When a user is added to a new group, the user has to be log out and log in again to make the new group effective. Is there any system command or technique to refresh user group ID update without re-login? I am not talking about to use "login" or "su -l" commands which can only make... (2 Replies)
Discussion started by: hce
2 Replies

2. AIX

How to find the year in last login details

Hi Friends I have a query. we had a requirement to see the last login details of our users so I ran the command last <username> and the output i get is: wtmp begins Apr 17 21:48 Now I need to know couple of things: 1. How can I see the year this log is being read from wtmp file 2. Is... (4 Replies)
Discussion started by: nathandrake13
4 Replies

3. Solaris

error message rmclomv ... SC Login Failure for user Please login:

Hello World ~ HW : SUN Fire V240 OS : Solaris 8 Error message prompts 'rmclomv ... SC login failure ...' on terminal. and Error Message prompts continually 'SC Login Failure for user Please login:' on Single Mode(init S) The System is in normal operation, though In case of rain, Can... (1 Reply)
Discussion started by: lifegeek
1 Replies

4. Shell Programming and Scripting

Need "year" value of user's last login

Hello, We have a requirement of finding which users logged into a UNIX (Solaris) box and how many times they logged in so far and their last login. I used "last" command in my script and got everything fine but not able to capture the "year" of date/time of the users' login. Looks like "last"... (2 Replies)
Discussion started by: prvnrk
2 Replies

5. Solaris

How to : Find last login year in solaris ?

Thanks AVKlinux (10 Replies)
Discussion started by: avklinux
10 Replies

6. HP-UX

How to : Find last login year in HPUX ?

Thanks AVKlinux (4 Replies)
Discussion started by: avklinux
4 Replies

7. Shell Programming and Scripting

How to : Find last login year ?

Friends , With "last root | head -1 " command , we can find the last loging date and month . But i want to find last login year. Help me if u have any idea regarding this issue. Thanks AVklinux (3 Replies)
Discussion started by: avklinux
3 Replies

8. Cybersecurity

APACHE: Tie in Web Page login with server login

Hello, I have created a web page on a server using apache and added .htaccess and .htpasswd in the folder for authentification. I was wondering if there was anyway to tie-in the login for this page with the login used to logon to the server. i.e. the same login info. is used for both, when... (1 Reply)
Discussion started by: WhotheWhat
1 Replies

9. Web Development

APACHE: Tie in Web Page login with server login

Hello, I have created a web page on a server using apache and added .htaccess and .htpasswd in the folder for authentification. I was wondering if there was anyway to tie-in the login for this page with the login used to logon to the server. i.e. the same login info. is used for both,... (2 Replies)
Discussion started by: WhotheWhat
2 Replies
Login or Register to Ask a Question