Delete secific line from file in linux

You can delete any specific line in linux using sed command.

Create file as testing and add some text line
$ vim testing
line 1
line 2
line 3
line 4
line 5

Delete 3rd line from file
sed "3 d" testing

Delete 3rd line from file permanently
sed -i "3 d" testing
Share on Google Plus

About Penguin Technology

I am a passionate cloud and DevOps professional specializing in Linux and open-source solutions. Through this blog, I share my knowledge and experience with the community, offering tips and insights on cloud technologies and DevOps practices.
    Blogger Comment

1 comments: