anniehswong
New Member
Would someone please advise how I can delete a duplicate line in a .txt file using the command line.
I have a file called Lab1.txt and me.txt
I was suppose to append the content in me.txt to Lab1.txt but somehow I did it twice and now my name is showing twice. I googled and used the command line sed '4d' Lab1.txt to delete the duplicate line, it worked at first but when I typed cat Lab1.txt to review the content, the changes did not save. I'm not exactly sure where I went wrong and I'm pretty new to linux. Would someone please advise? Thanks!
sed '4d' Lab1.txt
I have a file called Lab1.txt and me.txt
I was suppose to append the content in me.txt to Lab1.txt but somehow I did it twice and now my name is showing twice. I googled and used the command line sed '4d' Lab1.txt to delete the duplicate line, it worked at first but when I typed cat Lab1.txt to review the content, the changes did not save. I'm not exactly sure where I went wrong and I'm pretty new to linux. Would someone please advise? Thanks!
sed '4d' Lab1.txt