LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to delete single line from file using line number. (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-delete-single-line-from-file-using-line-number-4175421831/)

gajananh999 08-13-2012 05:16 AM

How to delete single line from file using line number.
 
Hello Everyone,

I want to delete one line from one file.
i know the line number. using this i want to delete

How to do this?

pixellany 08-13-2012 05:25 AM

Delete 5th line:
Code:

sed '5d' filename > newfilename
OR
sed -i '5d' filename

Read all about it here: http://www.grymoire.com/Unix/Sed.html


All times are GMT -5. The time now is 08:41 AM.