Sponsored Content
Full Discussion: Get List of users+IPs
Operating Systems AIX Get List of users+IPs Post 302929517 by -=XrAy=- on Monday 22nd of December 2014 09:38:26 AM
Old 12-22-2014
Quote:
Originally Posted by ibmtech
Just do nslookup <hostname>, it should give you IP address.
I was bored... Smilie
Code:
IFS=;who -ub | while read LINE;do IP=$(echo $LINE|sed -n "s/.*(\(.*\)).*/\1/p"|xargs -I{} dig +short {});echo $LINE|sed "s/(.*)/($IP)/g";done

Maybe there is a more elegant way.

Regards
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

List of IPs & database lookup

I am trying to feed a list of IP's to do lookups from a database. My script works only for the first IP but all subsequent IPs output as 'unknown'. #!/usr/bin/php -q <? $ip = file('ip.txt'); foreach ($ip as $ip_num => $ip) { echo $ip; $out=sprintf("%u", ip2long($ip)); ... (1 Reply)
Discussion started by: hazno
1 Replies

2. Programming

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. (2 Replies)
Discussion started by: xyzt
2 Replies

3. HP-UX

how to list locked users in hp-ux?

Actually.I have 2 questions to ask. 1. how to list locked account in hp-ux? 2.how to list locked account in linux(redhat)? I can use the command "passwd -S -username" to list a account who were locked . who knows how to list all locked accounts with one command. Thanks!! (5 Replies)
Discussion started by: robbiezr
5 Replies

4. Shell Programming and Scripting

Filter a list of IPs

Hello, I have a dump of IPs (around 2 million) and i need to filter out(delete) 37 IPs from this list. Here is a short list of IPs that i would need deleted 111.111.xxx.xxx 123.123.xxx.xxx 127.x.x.x 98.20.xx.xxx 10.135.xxx.xxx 11.105.xxx.xx 100.100.xxx.xxx 101.xxx.xx.xxx ... (11 Replies)
Discussion started by: senormarquez
11 Replies

5. Shell Programming and Scripting

Get Ips from a list file

Hi Everyone, I typed a command: awk '{ print $1}' $LOGFILE | sort | uniq -c | sort -nr > $DEST/a.txt And I got file a.txt which show 6 1.1.1.1 3 2.2.2.2 2 3.3.3.3 1 4.4.4.4 Just now, I want to get exact ips which has first column > 5 to a file b.txt. In this situation, the... (5 Replies)
Discussion started by: testcase
5 Replies

6. UNIX for Dummies Questions & Answers

List system users and..

Hello i need fast help... script which will list only human users from /etc/passwd and find out if they have something in home. Thanks (11 Replies)
Discussion started by: mentoscz
11 Replies

7. UNIX for Advanced & Expert Users

list of users

Hello!Does anybody know how to solve this script: ,,write a shell script which displays a list of names of users who have created files "*. c" in the last day."? (1 Reply)
Discussion started by: theodoraa
1 Replies

8. UNIX for Dummies Questions & Answers

Users list

Hi i would like to know were the folder that contain file with list of all users ? And were i can learn about what kind of folder i have and wheat they have inside? question 2. when i write ls -a i see all directories and then i choose for example Documents and inside Documents i typed again... (1 Reply)
Discussion started by: iliya24
1 Replies

9. Shell Programming and Scripting

List the Manager of Users in AD - Using list- Get-ADuser

Is there any command that can used in Linux that export usernames and their manager's name from AD using bash shell script? I know this can be done using powershell but I need to use Linux for this procedure. (2 Replies)
Discussion started by: dellanicholson
2 Replies
RNANO(1)						      General Commands Manual							  RNANO(1)

NAME
rnano - Restricted mode for Nano's ANOther editor, an enhanced free Pico clone SYNOPSIS
rnano [OPTIONS] [[+LINE,COLUMN] FILE]... DESCRIPTION
This manual page briefly documents the rnano command. nano is a small, free and friendly editor which aims to replace Pico, the default editor included in the non-free Pine package. Rather than just copying Pico's look and feel, nano also implements some missing (or disabled by default) features in Pico, such as "search and replace" and "go to line and column number". rnano is a restricted version of nano, which only edits specific files and doesn't allow the user access to the filesystem or a command shell. In restricted mode, nano will not: o read or write to any file not specified on the command line; o read any nanorc files; o allow suspending; o allow a file to be appended to, prepended to, or saved under a different name; o use backup files or spell checking. OPTIONS
+LINE,COLUMN Places cursor at line number LINE and column number COLUMN (at least one of which must be specified) on startup, instead of the default of line 1, column 1. -? Same as -h (--help). -h (--help) Show a summary of command line options and exit. -V (--version) Show the current version number and exit. See the nano(1) manpage for the complete documentation of nano. BUGS
Please send any comments or bug reports to nano@nano-editor.org. The nano mailing list is available from nano-devel@gnu.org. To subscribe, email to nano-devel-request@gnu.org with a subject of "subscribe". HOMEPAGE
http://www.nano-editor.org/ AUTHOR
Chris Allegretta <chrisa@asty.org>, et al (see AUTHORS for details). This manual page was originally written by Thijs Kinkhorst <thijs@kinkhorst.com>, for the Debian system (but may be used by others). August 23, 2007 version 2.0.0 RNANO(1)
All times are GMT -4. The time now is 03:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy