2 Replies - 1383 Views - Last Post: 26 March 2009 - 05:13 PM Rate Topic: -----

#1 Circuit_Girl  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 34
  • Joined: 25-February 09

Help with script to track user logins and number of times

Post icon  Posted 19 March 2009 - 04:33 PM

I am very new to Unix but I am learning. I am working on script writing. I know a lot of perl but as far as bash and awk and all the other scripting languages that is what I am trying to learn.

I want to create a script that when it is ran it will execute the last command to display who has logged into my system. I want to capture all these users and display how many times they have logged in.

What is the best language to use and where do I begin. I need some help getting started. I am completely lost.

Thank you

Is This A Good Question/Topic? 0
  • +

Replies To: Help with script to track user logins and number of times

#2 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5388
  • View blog
  • Posts: 27,382
  • Joined: 10-May 07

Re: Help with script to track user logins and number of times

Posted 19 March 2009 - 06:51 PM

View PostCircuit_Girl, on 19 Mar, 2009 - 05:33 PM, said:

What is the best language to use and where do I begin.

Honestly, you could write this in anything. The important part to remember is the steps that a Unix system takes when logging a user in.

Depending on the shell used by the system (not the user(s)), there is a login script per user that launches each time they sign in. There is also one for when the sign out.

Ideally, you would call your program (if written in C or Perl) or run your script from this file. You would need to check the documentation of the shell that you are running, but it's usually _login. Such as ~/.bash_login or ~/.ksh_login
Was This Post Helpful? 0
  • +
  • -

#3 Circuit_Girl  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 34
  • Joined: 25-February 09

Re: Help with script to track user logins and number of times

Posted 26 March 2009 - 05:13 PM

I want to see who owns more files me or root? I do not want to include directories in my search. I want it to output two lines...root (# of files) myusername (# of Files). What command tells who owns a file? and where is a good place to start?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1