To remove duplicates in linux you can use awk command as follows:
awk -F- '!seen[$1]++' file.txt > output.txt
where:
-F is paraeter to deternime separator used to define columns and in ths case the dash 8-) is the sparator used
'!seen[$1]++' is the expression used for the line in order to be printed
> is the instruction to send command output o a file
awk -F- '!seen[$1]++' file.txt > output.txt
where:
-F is paraeter to deternime separator used to define columns and in ths case the dash 8-) is the sparator used
'!seen[$1]++' is the expression used for the line in order to be printed
> is the instruction to send command output o a file
Comments