GNU/linux 2.6, slackware 12.0
I want to print, using locate, all the paths that contain the element /bin/ but only one instance of each one. If I issue 'locate /bin/' then I have many screens of text with, for example,
whereas I want to see only
That is to say, if in two lines /bin/ appears with the same prefix (in the example above the prefixes would be /usr and /home/me) I only want to print the first line.
Can I pipe locate to grep to do this? I've mentioned locate because it does not scan the whole disk.
Thanks in advance.