Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Easy Script, just to find the given username if is it online or not Post 302361789 by thegeek on Wednesday 14th of October 2009 06:11:29 AM
Old 10-14-2009
Ya, you are right.

Exclude the first line, and have all the remaining lines in the script. Execute the script, which would ask you a user name and finds out whether that persons is logged in or not.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to find who fingered my username

Hi Everyone, Whenever someone uses the finger command against my username, he.she gets my info. Is there a way to find who ran the command against my username, somewhat like a log file for the finger command. I would be greatful if someone to clear my query. Regards Anirudh Koul... (3 Replies)
Discussion started by: anirudhkoul
3 Replies

2. UNIX for Dummies Questions & Answers

Find, make and move file based on username

hi there, i'm new to UNIX( just 3month used), i found my new box contained alot of files and directories in /home/box/ i've tried to search script in tis forum and found many of them but, i don't know how to combine them to make a script, although using pipes. my tasks are: 1) to scan user... (5 Replies)
Discussion started by: Helmi
5 Replies

3. UNIX for Dummies Questions & Answers

Need help on installing an EASY to use and easy to install command line text editor

Hi again. Sorry if it seems like I'm spamming the boards a bit, but I figured I might as well ask all the questions I need answers to at once, and hopefully at least get some. I have installed Solaris 10 on a server. The default text editors are there (vi, ex, ed, maybe others, I know emacs is... (4 Replies)
Discussion started by: EugeneG
4 Replies

4. Shell Programming and Scripting

Find username of user running the script

Hello All, If I have a simple cgi script and want to find the name of the person accessing the page, is it possible? How do I get the name of this user? Please help. I was trying a vague method but it doesn't seem to work with all browsers and versions ... $val=$ENV{'HTTP_COOKIE'}; $name... (1 Reply)
Discussion started by: garric
1 Replies

5. Shell Programming and Scripting

To find the username in /etc/passwd file

Hi, I need to a shell script to list out only the username in the /etc/passwd file. Regards Siva (7 Replies)
Discussion started by: gsiva
7 Replies

6. UNIX for Advanced & Expert Users

how to find any device online/offline

what is the command for checking which device active and which is not active (1 Reply)
Discussion started by: RahulJoshi
1 Replies

7. UNIX and Linux Applications

grep file to find unique instances of username

hello - A SystemOut.log file has recurring entries that follow this format: Principal: auth9.nick.al.gov:389/USERNAME Over the course of a day thousands of lines similar to this are produced, with each username represented hundreds of times. I need to create a new file that shows... (4 Replies)
Discussion started by: 1075FJ40
4 Replies

8. IP Networking

iptables - most easy way to find rule and remove it?

I have situation where I have rules in iptables with comments. Now... I can for example enter rule like "iptables -A FORWARD -s xxx -j ACCEPT" and delete it with "iptables -D FORWARD -s xxx -j ACCEPT".. but if that rule contain some random comment (-m comment) then ... ? I can find with scripting... (2 Replies)
Discussion started by: darkman_hr
2 Replies

9. Shell Programming and Scripting

Using grep with 'who' to find online users

solved (3 Replies)
Discussion started by: subway69
3 Replies
printpw(8)						      System Manager's Manual							printpw(8)

NAME
printpw - Outputs the contents of the password database SYNOPSIS
printpw [-acdgsu] FLAGS
Outputs all information. Use of this flag is the same as specifying all flags with -cdgsu. Outputs username and the comment string. Out- put username and the login directory. Outputs username and the group ID numerical value. Output username and the login shell. Output username and the UID numerical value. DESCRIPTION
The printpw command outputs the contents of the /etc/passwd database file in ASCII format to the standard output. When printpw is called with no option, all usernames in the database are output. The /etc/passwd database file is accessed through the standard library function getpwent. On secure systems that have changed this library function or on systems with Network Information Service (NIS) service installed, printpw produces the same information. When printpw is called in combination with any flag, one or more additional columns separated with : (colon) is output. EXAMPLES
To output the username, UID, and login directory of all users in the password database file, enter: /usr/sbin/acct/printpw -ud FILES
Specifies the command path The password database file. RELATED INFORMATION
Commands: acct(8) delim off printpw(8)
All times are GMT -4. The time now is 09:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy