Timeline for Remove lines based on duplicates within one column without sort
Current License: CC BY-SA 3.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Sep 5, 2021 at 11:53 | comment | added | Ed Morton | @Ramesh there's no indication in the question that using -t' ' would be useful or even the right thing to do, it'd break if the input was tab-separated for example. | |
| Sep 5, 2021 at 11:52 | comment | added | Ed Morton | @Bharat GNU sort has a -s option to handle that. | |
| Sep 5, 2021 at 11:51 | comment | added | Ed Morton | @PhilCoulson - -k3 would sort using the string starting with the 3rd key rather than sort ONLY using the 3rd key. Try printf 'a b\na c\n' | sort -k1,1 -u vs printf 'a b\na c\n' | sort -k1 -u. | |
| Apr 4, 2020 at 13:07 | comment | added | Rajat | @Ramesh-Why do we need -k3,3 instead of just -k3? | |
| Apr 26, 2018 at 7:28 | comment | added | Bharat | @Ramesh it does the job but sorting changes the sequence of lines that I guess not expected always. | |
| Feb 15, 2018 at 4:40 | comment | added | Randoms | Was about to comment snarkily that -u would only remove duplicate lines, not duplicate keys... but I'm wrong. | |
| Apr 13, 2017 at 12:36 | history | edited | CommunityBot | replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/ | |
| Dec 2, 2014 at 16:47 | history | answered | Ramesh | CC BY-SA 3.0 |