I don't think that "uniq -u" does what is needed here.This might be closer to what you're looking for:
perl -ni -e 'print if !$seen{$_}++' /etc/fstab
but that would also remove repeated comment lines which may be desired in some cases. Best to just not add duplicates in the first place.
I don't think that "uniq -u" does what is needed here.This might be closer to what you're looking for:
perl -ni -e 'print if !$seen{$_}++' /etc/fstab
but that would also remove repeated comment lines which may be desired in some cases. Best to just not add duplicates in the first place.