How can I find a user profile


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How can I find a user profile
# 1  
Old 04-15-2008
How can I find a user profile

Hi, I want to know how can i find a user when he has logged in and how many times and days
# 2  
Old 04-15-2008
The last command shows logins
Code:
last -100 username

example:
Code:
last jmcnama
jmcnama  pts/4        Tue Apr 15 09:51   still logged in
jmcnama  pts/1        Mon Apr 14 09:02 - 16:33  (07:30)
jmcnama  ftp          Fri Apr 11 12:31 - 12:33  (00:02)
jmcnama  pts/2        Thu Apr 10 08:53 - 16:25 (1+07:31)
jmcnama  pts/2        Wed Apr  9 09:14 - 16:29  (07:14)
jmcnama  pts/2        Tue Apr  8 16:44 - 16:58  (00:14)
jmcnama  ftp          Tue Apr  8 16:34 - 16:35  (00:01)
jmcnama  pts/2        Tue Apr  8 09:05 - 16:37  (07:31)
jmcnama  pts/3        Mon Apr  7 08:55 - 19:12  (10:17)
jmcnama  pts/1        Fri Apr  4 08:57 - 18:46  (09:48)
jmcnama  pts/21       Thu Apr  3 10:57 - 08:56  (21:59)
jmcnama  pts/21       Thu Apr  3 10:21 - 10:57  (00:36)
jmcnama  pts/23       Wed Apr  2 12:48 - 13:38  (00:50)
jmcnama  pts/1        Tue Apr  1 14:09 - 20:06 (1+05:56)
jmcnama  pts/4        Mon Mar 31 09:10 - 20:20  (11:09)
jmcnama  pts/7        Fri Mar 21 09:38 - 16:17  (06:39)
jmcnama  pts/17       Thu Mar 20 11:33 - 20:22  (08:48)
jmcnama  pts/13       Thu Mar 20 11:12 - 11:12  (00:00)
jmcnama  pts/13       Thu Mar 20 11:11 - 11:11  (00:00)
jmcnama  ftp          Tue Mar 18 15:37 - 15:40  (00:02)
........... goes on and on

login count by day and number of logins
Code:
> last jmcnama |\
awk '{arr[$3 $4 $5]++}
     END { for(i in arr) {cnt++}
     print "logins", NR, "days ", cnt }'
logins 254 days  144
>

change the username to whatever you want.
# 3  
Old 04-15-2008
does the output of "last username" help?

(to late Smilie)

btw. i moved the post cause it has nothing to do with ip networking!

Last edited by DukeNuke2; 04-15-2008 at 05:54 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Copying the .profile of one user to another.

I want to copy .Profile file from user1 homedirectoryto user2 homedirectory in Aix. Please help me with the process. (4 Replies)
Discussion started by: Laxxi
4 Replies

2. Shell Programming and Scripting

User profile, environment

Hello , i am on sles 11, and i can't figure out how can i locate my profile file, the one that is use for setting the environment when i log in. oracle@r200:~> cd oracle@r200:~> pwd /opt/oracle oracle@r200:~> echo $SHELL /bin/bash oracle@r200:~> oracle@r200:~> cat .profile cat: .profile:... (4 Replies)
Discussion started by: tonijel
4 Replies

3. Infrastructure Monitoring

trap in etc/profile and user .profile

Hello I really wonder what's trap in etc/profile and in each user .profile. I try to google for it but I think I have no luck. Mostly hit is SNMP traps which I think it is not the same thing. I want to know ... 1. What's a "trap 2 3" means and are there any other value I can set... (4 Replies)
Discussion started by: Smith
4 Replies

4. AIX

Which file has the user profile?

It's been a long time since I've done this and I can't remember which file is needed to edit. I would like to change the prompt for a user on my AIX 5.3 box, but I don't see a .profile file or a rc.ksh file to edit. Which file do I need to edit to get this? (1 Reply)
Discussion started by: bbbngowc
1 Replies

5. IP Networking

how can i find a user profile

Hi I want to know how can i find a user when he has logged in, at what time and how many days, anyone can help me (1 Reply)
Discussion started by: darwinscp@hotma
1 Replies

6. UNIX for Dummies Questions & Answers

refresh user profile

Scenario: a non-root user is under primary group "devel" and I change their primary group to "nondevel"; I then want to be able to give the user a command which refreshes their user profile so that any new files created under their session are assigned to the new group. What is the command for... (1 Reply)
Discussion started by: dhinge
1 Replies

7. UNIX for Dummies Questions & Answers

User Profile

Hi Guys, Im really new with this stuff...could anybody help to guide me ...how do i change/edit user profiile ? (2 Replies)
Discussion started by: gagasan_makmur
2 Replies

8. Shell Programming and Scripting

accerssing user profile?

Hello there, I would like to know how can i prevent a normal user (not root user) from accessing his .profile and editing its information? Also, how can i prevent this user from deleting a certain file named "script"? Any help in that? Thanks in advance, (3 Replies)
Discussion started by: charbel
3 Replies

9. Shell Programming and Scripting

User profile

Sorry to I am not familiar with script writing , attach is the /etc/profile in my system , we have limit each user can only have one login in the system . When the user login , if the system found the user have a dead process in the system , the system will confirm the user to kill the previous... (1 Reply)
Discussion started by: ust
1 Replies
Login or Register to Ask a Question