04-15-2009
Get the list of logged in users
How can I get the list of logged in users in the system programmatically?
I can get the list with 'who' or 'users' commands but I need to get the list programmatically...
May someone help, please?
Thanks in advance.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
in unix what is the syntax to find out how many users are currently logged in (4 Replies)
Discussion started by: trichyselva
4 Replies
2. Shell Programming and Scripting
I'm trying to execute a single shell command that will give me a sorted list of all the users currently logged into the system, displaying the users name as it appears in /etc/passwd.
I've tried
awk -F: '{print $1}' /etc/passwd | xargs finger -s | cut -c11-28 | uniq
This list whoever does... (7 Replies)
Discussion started by: kungfuice
7 Replies
3. Post Here to Contact Site Administrators and Moderators
how to find out users who logged out within 5 minutes (1 Reply)
Discussion started by: roshni
1 Replies
4. UNIX for Dummies Questions & Answers
Hi,
Can I get a script to list out all the users, who has not logged on since last 90 days. Last command in not working due due to /var/adm/wtmpx is more than 2 GB.
Thanks in advance.
Regards,
Roni (10 Replies)
Discussion started by: manasranjanpand
10 Replies
5. Solaris
I need actuall script which List all inactive users who has not logged on since last 90 days
Thanks in advance.
Di! (17 Replies)
Discussion started by: haridham
17 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I'm trying to do a list of user that never connected to a couple of servers. I want to do a diff between the servers lists, and print out only the users that never has logged on each server. Here my first step :
SERVER01:
# finger `egrep -v -e "^\s*#" /etc/passwd | awk '{ print $1 }' |... (4 Replies)
Discussion started by: gogol_bordello
4 Replies
7. Shell Programming and Scripting
I have searched the forums but have not mangaed to quite find what im looking for. I have used to /etc/passwd command to present me a list of all users the who command to present all users currently logged on, but what i want to know is what command can i use to display users that are registered... (12 Replies)
Discussion started by: warlock129
12 Replies
8. UNIX for Dummies Questions & Answers
How do I find this out? I have a feeling its a simple command such as who, but I just don't know what it is. I've had a search on here but either I can't put it into the right search criteria or there isn't a topic on it.
Thanks.
EDIT: Delete this thread, as I posted it I noticed the... (0 Replies)
Discussion started by: chris_rabz
0 Replies
9. Shell Programming and Scripting
Hi everyone,
At work we were told to check the list of users of an application server and delete all those that have left the company or don't need access to the application anymore. Here's what I came up with. Would you be as kind as to tell me your opinion and whether there is a faster / easier... (4 Replies)
Discussion started by: gacanepa
4 Replies
10. Shell Programming and Scripting
Hi Guys!
I am sure that this question might appeared previously, but I still don't know how to show a list of logged out users. Please help with this!
Thanks in advance:) (5 Replies)
Discussion started by: saloliubliu
5 Replies
LEARN ABOUT PLAN9
lpusers
lpusers(1M) System Administration Commands lpusers(1M)
NAME
lpusers - set printing queue priorities
SYNOPSIS
lpusers -d priority-level
lpusers -q priority-level -u login-ID-list
lpusers -u login-ID-list
lpusers -q priority-level
lpusers -l
DESCRIPTION
The lpusers command sets limits to the queue priority level that can be assigned to jobs submitted by users of the LP print service.
The first form of the command (with -d) sets the system-wide priority default to priority-level, where priority-level is a value of 0 to
39, with 0 being the highest priority. If a user does not specify a priority level with a print request (see lp(1)), the default priority
level is used. Initially, the default priority level is 20.
The second form of the command (with -q and -u) sets the default highest priority-level (0-39) that the users in login-ID-list can request
when submitting a print request. The login-ID-list argument may include any or all of the following constructs:
login-ID A user on any system
system_name!login-ID A user on the system system_name
system_name!all All users on system system_name
all!login-ID A user on all systems
all All users on all systems
Users that have been given a limit cannot submit a print request with a higher priority level than the one assigned, nor can they change a
request that has already been submitted to have a higher priority. Any print requests submitted with priority levels higher than allowed
will be given the highest priority allowed.
The third form of the command (with -u) removes any explicit priority level for the specified users.
The fourth form of the command (with -q) sets the default highest priority level for all users not explicitly covered by the use of the
second form of this command.
The last form of the command (with -l) lists the default priority level and the priority limits assigned to users.
OPTIONS
The following options are supported:
-d priority-level
Set the system-wide priority default to priority-level.
-l
List the default priority level and the priority limits assigned to users.
-q priority-level
Set the default highest priority level for all users not explicitly covered.
-q priority-level -u login-ID-list
Set the default highest priority-level that the users in login-ID-list can request when submitting a print request.
-u login-ID-list
Remove any explicit priority level for the specified users.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
non-zero An error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWpsu |
+-----------------------------+-----------------------------+
SEE ALSO
lp(1), attributes(5)
SunOS 5.10 19 Aug 1996 lpusers(1M)