PDA

View Full Version : [SOLVED] Read all lines that begin with a specific word Unix Scripting



hakermania
May 9th, 2010, 07:39 PM
Hi, i have a file and i want to read all lines that start with
<PassportName>
Any help?
thx!

soltanis
May 9th, 2010, 07:44 PM
grep "<PassportName>" [file]

Portmanteaufu
May 9th, 2010, 09:03 PM
grep "<PassportName>" [file]


Yup yup! Grep is your friend. However, if you only want lines that start with PassportName, you'll need to use:


grep '^PassportName' [file]

The leading carat (^) specifies that it should only print the line if PassportName's at the very beginning.

hakermania
May 12th, 2010, 07:46 AM
Thank you VERY much!