Remove duplicate entries in a Bash script [duplicate] October 14, 2022 by Tarik You can sort then uniq: $ sort -u input.txt Or use awk: $ awk '!a[$0]++' input.txt