08-13-2002
A couple of workarounds here, but ideally you would want to use the last file.
You might want to think about truncating the last file upto a certain period instead of removing the whole file - that way you'd always have enough data in there to assess whether you want to delete or not.
Or you could find a list of .profile files that were last accessed greater than a certain period of time....
Or you could add a variable to the .profile file for each user that sets say 'last_accessed=date'. Then you could parse the .profile files and find ones that have old dates. Each time a user signed in the variable would be updated - so if it's an old date it means they haven't logged in for a while.
8 More Discussions You Might Find Interesting
1. Filesystems, Disks and Memory
I've been setting up a duplicate system to replace an ailing ultra 2, same os version, same file & directory structure, same databases, now I just wanted to doublecheck that for user info, to copy over exact user login info, i need to copy the etc/passwd, etc/group and etc/shadow files. THis will... (6 Replies)
Discussion started by: kymberm
6 Replies
2. UNIX for Dummies Questions & Answers
I know this is prob a simple question but anyway here goes. I want to find out the owner of a certain file. I also want to find out what permissions that owner has. Is their any command that is similair to file in that it can tell men this specfic information about a file the way file tells you... (1 Reply)
Discussion started by: Quesa
1 Replies
3. UNIX for Dummies Questions & Answers
How could I get the details about a user logged in a Unix system? ( WHat tasks did he perform or if he had changed any file or not)? Please answer my question. (1 Reply)
Discussion started by: s_dhar
1 Replies
4. UNIX for Dummies Questions & Answers
Hi guys,
May I know how do I list out in UX for
- all existing user accounts; sorted by activated/disabled
- primary/sec groups of each user
- date when the user accounts are created,
- user last logon date
- last password change date
Anyone had done scripting for these info?... (0 Replies)
Discussion started by: doom10
0 Replies
5. Shell Programming and Scripting
Hi I need help..........
I have an Sun One Directory server LDIF file with 5000 user entries, I need to change the data to match Test ID's, so I can run a perf test.
I'm way out of my league as I have not done any scripting for 10 years.
There are four entries for each user in the file... (3 Replies)
Discussion started by: Macdaddy99
3 Replies
6. Shell Programming and Scripting
Please forgive this newbie question. I have a need to create a script that asks a user for information. Something like:
What is the name: $NAME_TYPED_HERE
Is $NAME_TYPED_HERE Correct ? YES (NO would go back to -What is the Name-)
mkdir then goes on behind the scene and makes folder called... (1 Reply)
Discussion started by: crowman
1 Replies
7. Linux
Hi Experts,
I'm not able to get the info of user's from wbinfo.
But I'm able to join the user in domain(net rpc join -U username....).
I have deleted the *.tdb file under /var/lib/smaba and
set winbind cache time = 40 and restarted the winbind,
Still it not works..
And not able to... (0 Replies)
Discussion started by: eeegopikannan
0 Replies
8. UNIX for Beginners Questions & Answers
Hi All,
i want to collect all the users info whose id greater than 999 and print the groups information which they belong.
example :
for user in $(cut -d: -f1,3 /etc/passwd | egrep ':{4}$' | cut -d: -f1); do groups $user; done
centos : centos adm wheel systemd-journal
balu : balu
... (2 Replies)
Discussion started by: balu1234
2 Replies
WHO(1) BSD General Commands Manual WHO(1)
NAME
who -- display who is on the system
SYNOPSIS
who [-abHmqsTu] [am I] [file]
DESCRIPTION
The who utility displays information about currently logged in users. By default, this includes the login name, tty name, date and time of
login and remote hostname if not local.
The options are as follows:
-a Equivalent to -bTu, with the exception that output is not restricted to the time and date of the last system reboot.
-b Write the time and date of the last system reboot.
-H Write column headings above the output.
-m Show information about the terminal attached to standard input only.
-q ``Quick mode'': List the names and number of logged in users in columns. All other command line options are ignored.
-s Show the name, line and time fields only. This is the default.
-T Indicate whether each user is accepting messages. One of the following characters is written:
+ User is accepting messages.
- User is not accepting messages.
? An error occurred.
-u Show idle time for each user in hours and minutes as hh:mm, '.' if the user has been idle less than a minute, and ``old'' if the user
has been idle more than 24 hours.
am I Equivalent to -m.
By default, who gathers information from the file /var/run/utx.active. An alternate file may be specified which is usually /var/log/utx.log
(or /var/log/utx.log.[0-6] depending on site policy as utx.log can grow quite large and daily versions may or may not be kept around after
compression by ac(8)). The utx.log file contains a record of every login, logout, crash, shutdown and date change since utx.log was last
truncated or created.
If /var/log/utx.log is being used as the file, the user name may be empty or one of the special characters '|', '}' and '~'. Logouts produce
an output line without any user name. For more information on the special characters, see getutxent(3).
ENVIRONMENT
The COLUMNS, LANG, LC_ALL and LC_TIME environment variables affect the execution of who as described in environ(7).
FILES
/var/run/utx.active
/var/log/utx.log
/var/log/utx.log.[0-6]
EXIT STATUS
The who utility exits 0 on success, and >0 if an error occurs.
SEE ALSO
last(1), users(1), w(1), getutxent(3)
STANDARDS
The who utility conforms to IEEE Std 1003.1-2001 (``POSIX.1'').
HISTORY
A who command appeared in Version 1 AT&T UNIX.
BSD
February 11, 2012 BSD