usage of grep cmd
|
Original Message
|
Name: urmilaravishankar
Date: September 30, 2007 at 07:05:35 Pacific
Subject: usage of grep cmd OS: linuxCPU/Ram: AMD anthlon,32 MB |
Comment: Hi Kindly give me the exact usage of grep such that it should display only lines with single words. In awk its cat filename|awk 'NF<2 {print $0}' will display lines with single word only
Report Offensive Message For Removal
|
|
Response Number 2
|
Name: Luke Chi
Date: February 7, 2008 at 14:13:38 Pacific
|
Reply: (edit)$ grep "^[^ ]*$" infile.txt Example: $ cat infile.txt This is a test file to test how grep can grep the lines with only one word. $ grep "^[^ ]*$" infile.txt file lines word. Luke Chi
Report Offensive Follow Up For Removal
|
Use following form to reply to current message: