Linux as Removing Duplicate Lines

Asked

Viewed 245 times

-1

Which Linux terminal command to remove duplicate lines of a.txt file?

1 answer

1


my favorite would be:

cat arquivo.txt | sort | uniq >  novo-arquivo.txt 

but this will reorder the lines. Without changing the order:

cat arquivo.txt | uniq >  novo-arquivo.txt 
  • That’s the one I need -> cat file.txt | Sort | Uniq > new-file.txt Thank you

Browser other questions tagged

You are not signed in. Login or sign up in order to post.