insert a word in a specific line in a file
I have a file called amer
#cat /tmp/amer 1-name 2-age 3-edu 4-email How I insert a word/sentence below the line number 2 ? I could execute : # echo "2.2 phone" >> /tmp/amer but that will append it at the end of the file. any help?awk and sed will help? |
Code:
sed -i '3i2.2 phone' /tmp/amer Code:
sed -i '3a2.2 phone' /tmp/amer Code:
sed -i '2a2.2 phone' /tmp/amer |
just want to add...
a - insert text after the defined line Quote:
Quote:
|
All times are GMT -5. The time now is 01:48 PM. |