LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Delete a line using sed (https://www.linuxquestions.org/questions/programming-9/delete-a-line-using-sed-588269/)

kushalkoolwal 09-29-2007 03:52 PM

Delete a line using sed
 
Hi,

I have a shell script say clean.sh. Now I want to delete all lines in a file called test.lst which starts with the word "initrd". How can I use sed command in my scripp clean.sh to achieve it?

THanks

colucix 09-29-2007 05:14 PM

Code:

sed -i /^initrd/d test.lst

kushalkoolwal 09-29-2007 07:25 PM

Quote:

Originally Posted by colucix (Post 2907864)
Code:

sed -i /^initrd/d test.lst


Thanks that worked!!!


All times are GMT -5. The time now is 04:11 PM.