AWK greater than 200


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting AWK greater than 200
# 1  
Old 02-05-2007
AWK greater than 200

I need to grep out usernames with UID's greater than 200 out of the /etc/passwd file for a server migration. It is the third field however I am not sure to to accomplish this. I tried to search the forums but did not seem to find an answer (might have over looked it). Any help would be appreciated.

Sean
# 2  
Old 02-05-2007
Code:
awk -F":" ' $3 > 200 ' /etc/passwd

# 3  
Old 02-05-2007
Bug

that worked perfectly thank you
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Awk: greater than sign is working upside down

Hi, I noticed a weird behaviour with awk. input: A|B|1-100|blabla_35_40_blabla;blabla_53_60_blabla;blabla_90_110_blabla Objective: For each string separated by ';' in $4, if the first and second numbers are included in the interval in $3, then print "TRUE". Otherwise print "FALSE". In... (3 Replies)
Discussion started by: beca123456
3 Replies

2. Shell Programming and Scripting

Xargs, awk, match, if greater - as a one-liner

Hi I have multiple files for which I want to use awk for the following: Read each line in each file- if any of the columns match "PVALUE=" followed by the number, then print the line in case the number following "PVALUE=" is greater than 0.05. I did the following: ls *.txt | xargs -I @ -P15... (14 Replies)
Discussion started by: ts89490
14 Replies

3. Shell Programming and Scripting

Calculate percentage of columns greater than certain value in a matrix using awk

This matrix represents correlation values. Is it possible to calculate the percentage of columns (a1, a2, a3) that have a value >= |0.5| and report the percentage that has positive correlation >0.5 and negative correlation <-0.5 separately. thanx in advance! input name a1 a2 a3... (5 Replies)
Discussion started by: quincyjones
5 Replies

4. Shell Programming and Scripting

awk to get values greater than

data.txt August 09 17:16 2013 August 09 17:17 2013 August 09 17:19 2013 August 09 17:20 2013 August 09 17:21 2013 August 09 17:22 2013 August 09 17:23 2013 August 09 17:24 2013 to print from a point in this file, to the end of the file, i type: awk '/August 09 17:22/,0' data.txt. ... (1 Reply)
Discussion started by: SkySmart
1 Replies

5. Shell Programming and Scripting

AWK: Cannot read Number of records greater than 1(NR>1)

Hi all, I have a tab-delimited text file of size 10Mb. I am trying to count the number of lines using, grep -c . sample.txtor wc -l < sample.txt or awk 'END {print NR}' sample.txtAll these commands shows the count as 1, which means they are reading only the first header line of the file.... (3 Replies)
Discussion started by: mehar
3 Replies

6. Shell Programming and Scripting

Greping the column with a value greater than 50 with awk

Hi All, I am running a command from a remote server using ssh to different servers. I will get a output like below with 4 columns. I want to grab line which is having a coulmn which grate than or equal to 50. How can I do it with Awk or sed ??. I add a space to first row with sed 's/::/:: /g' to... (4 Replies)
Discussion started by: raghin
4 Replies

7. Shell Programming and Scripting

Need to Grep or awk a logfile for greater than value

Hello all Hoping someone would be kind enough to suggest a solution to a problem i have, and see if maybe i can even do this without a script. Essentially i have a very large log file, and within it each line had a value called TTMT, and it records a variable number in the following way, so... (6 Replies)
Discussion started by: 1905
6 Replies

8. Shell Programming and Scripting

AWK greater than?

Sorry for such a basic question, but I have spent hours trying to work this out! I need an awk command (or similar) that will look at a text file and output to the screen if the 4th column of each line has a value greater than or equal to x. data.txt This is the 1 line This is the 2 line This... (6 Replies)
Discussion started by: dlam
6 Replies

9. Shell Programming and Scripting

[awk]: Row begins by random number and field 10 is greater than 10.00%

Hello! I wish to extract the pid where CPU is above 10% last pid: 22621; load averages: 4.71, 5.04, 5.13 15:08:34 221 processes: 212 sleeping, 2 running, 1 stopped, 6 on cpu CPU states: %... (3 Replies)
Discussion started by: Lomic
3 Replies
Login or Register to Ask a Question