//Tips tagged uniq
Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
You can use the 'uniq' command to handle duplicate lines in a file:
$ cat tst a a b c c d
$ uniq -d tst //show duplicated lines a c
$ uniq -u tst //show unique lines b d
$ uniq tst //remove duplicates a b c d
You might want to get rid of the awk, sort, uniq and grep depending on how much info you need.
for dir in $(find /proc -maxdepth 1 -type d -name "*[0-9]");do ls -l $dir/fd/ | awk '{print $11}';done | sort | uniq | grep "^/var/"

