search for files or directories, then show a sorted list of just the unique directories where the matches occur

for i in $(locate your_search_phrase); do dirname $i; done | sort | uniq
Ever use 'locate' to find a common phrase in a filename or directory name? Often you'll get a huge list of matches, many of which are redundant, and typically the results are not sorted. This command will 'locate' your search phrase, then show you a sorted list of just the relevant directories, with no duplications. So, for example, maybe you have installed several versions of the java jre and you want to track down every directory where files matching "java" might exist. Well, a 'locate java' is likely to return a huge list with many repeated directories since many files in one directory could contain the phrase "java". This command will whittle down the results to a minimal list of unique directory names where your search phrase finds a match.

2
2009-02-05 14:03:20

1 Alternatives + Submit Alt

What Others Think

You should have used "sort -u" instead of "sort | uniq".
dardo1982 · 385 weeks and 2 days ago
How can i delete a comment and change my profile picture?
dardo1982 · 385 weeks and 2 days ago
private investigator tucson I need to know more
yeoyeo · 97 weeks and 3 days ago
thanks alot for this, great site! how to find a life coach
looneyhans · 83 weeks and 5 days ago
You are helping me a lot with codes. I really love to browse this site. Because all the answers to my coding doubts are available here. Please do not stop updating such useful information. I would love to check it. video conferencing installation
charlly · 70 weeks ago
Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir   Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir Seofox.ir
seofox · 44 weeks and 4 days ago
Pug Puppies for Sale Near Me pugs puppies for sale teacup pugs for sale pug puppies for sale by owner pug puppies ohio PUG PUPPY FOR SALE NEAR ME PUG PUPPIES FOR SALE pug puppies for sale in kentucky Pug Puppies for Sale Under $500 Near Me pug puppies for sale in texas pug puppies for sale $200 pugs for sale near me under $500 pugs for sale under $400 near me pugs for sale near me puppies for sale near me under $500 pug puppies for sale under $1,000 near me pug for sale pug puppies for sale under $300 Brindle Pug Pitbull Pug Mix Pugs for sale cheap Cheap pug affordable pug puppies for sale near me black pugs for sale near me White Pugs for sale pug dog for sale free pug puppies pug puppies for sale in my area mn pug breeders pug puppies indiana pugs for sale michigan PUG PUPPY ADOPTION Pug puppies for sale Pug puppies for sale near me Pug puppies near me Pug Puppies for Sale Under $500 Near Me Cute Pug Puppies Black pug puppies Black pug puppies for sale pug puppies for adoption black pug puppies for sale near me chihuahua pug mix puppies how much is a pug puppy teacup pug puppies baby pug puppies pictures of pug puppies pug puppies for sale in Ohio pug puppies price pug mix puppies teacup pug puppies for sale best food for pug puppy newborn pug puppies pug puppies craigslist pug puppies for sale craigslist adorable pug puppies how much does a pug puppy cost Pitbull pug mix puppies pug pit mix puppy pug puppies for sale $200 pug puppies for sale in NJ Pug puppies for sale in Wisconsin pug puppy cost pug puppy food royal canin pug puppy royal canin pug puppy food fawn pug puppy pug puppies for sale florida pug puppies for sale in Indiana pug puppies for sale in KY/A> pug puppies for sale in NC pug dog puppy AKC Registered Pug Puppies For sale cheap pug puppies for sale near me cheap pug puppies for sale in California cheap pug puppies for sale in nj Black Pug Puppies for sale pugs puppies for sale
AnthonyLewis9201 · 4 weeks and 2 days ago
http://cracktopc.org/ http://cracktopc.org/malwarebytes-crack/ http://cracktopc.org/exiftoo-crack/ http://cracktopc.org/virtual-dj-pro-crack/ http://cracktopc.org/ableton-live-suite-crack/ http://cracktopc.org/norton-antivirus-plus-3-9-crack/ http://cracktopc.org/openaudible-crack/ http://cracktopc.org/idrive-crack/ http://cracktopc.org/hma-pro-vpn-crack/ http://cracktopc.org/windows-11-crack/ http://cracktopc.org/nordvpn-crack/ http://cracktopc.org/ipvanish-crack/ http://cracktopc.org/camtasia-studio-crack/ http://cracktopc.org/clo-standalone-crack/ http://cracktopc.org/imazing-crack/ http://cracktopc.org/wtfast-crack/ http://cracktopc.org/avocode-crack/ http://cracktopc.org/webstorm-crack/ http://cracktopc.org/ntlite-crack/ http://cracktopc.org/readiris-pro-crack/ http://cracktopc.org/mirillis-action-crack/ http://cracktopc.org/macdrive-pro-crack/ http://cracktopc.org/transmac-crack/ http://cracktopc.org/nero-burning-rom-crack/ http://cracktopc.org/dxo-photolab-crack/ http://cracktopc.org/panda-antivirus-pro-crack/ http://cracktopc.org/mackeeper-crack/ http://cracktopc.org/iobit-driver-booster-crack/ http://cracktopc.org/wirecast-pro-crack/ http://cracktopc.org/3dmark-crack/ http://cracktopc.org/ivacy-vpn-crack/ http://cracktopc.org/privatevpn-crack/ http://cracktopc.org/cubase-pro-crack/ http://cracktopc.org/planet-coaster-crack/ http://cracktopc.org/cinch-audio-recorder-crack/ http://cracktopc.org/master-pdf-editor-crack/ http://cracktopc.org/microsoft-edge-crack/ http://cracktopc.org/adobe-premiere-rush-cc-crack/ http://cracktopc.org/roboform-crack/ http://cracktopc.org/reaper-crack/ http://cracktopc.org/recuva-pro-crack/ http://cracktopc.org/bulk-image-downloader-crack/ http://cracktopc.org/avira-phantom-vpn-pro-crack/ http://cracktopc.org/playon-crack/ http://cracktopc.org/resolume-arena-crack/ http://cracktopc.org/iexplorer-crack/ http://cracktopc.org/pdf-expert-crack/ http://cracktopc.org/k7-total-security-crack/ http://cracktopc.org/avast-password-crack/ http://cracktopc.org/total-commander-crack/ http://cracktopc.org/master-pdf-editor-crack-2/ http://cracktopc.org/idrive-crack-2/ http://cracktopc.org/file-viewer-plus-crack/ http://cracktopc.org/light-image-resizer-crack/ http://cracktopc.org/ultra-fractal-crack/ http://cracktopc.org/easeus-partition-master-crack/ http://cracktopc.org/apple-motion-crack/ http://cracktopc.org/youtube-by-click-crack/ http://cracktopc.org/clamxav-crack/ http://cracktopc.org/express-vpn-crack/ http://cracktopc.org/download-dropbox-crack/ http://cracktopc.org/luminar-crack/ http://cracktopc.org/adobe-acrobat-pro-dc-crack/ http://cracktopc.org/wise-care-365-pro-crack-2/ http://cracktopc.org/sony-vegas-pro-crack/ http://cracktopc.org/unhackme-crack/ http://cracktopc.org/openshot-video-editor-crack/ http://cracktopc.org/4k-video-downloader-crack/ http://cracktopc.org/wise-care-365-pro-crack/ http://cracktopc.org/reason-crack-crack/ http://cracktopc.org/photo-mechanic-6-3-crack-license-key-free-download-2022/ http://cracktopc.org/kerio-control-crack/ http://cracktopc.org/revo-uninstaller-pro-crack/ http://cracktopc.org/ccleaner-pro-crack/ http://cracktopc.org/gravit-designer-pro-crack/ http://cracktopc.org/hide-all-ip-crack/ http://cracktopc.org/bandicam-crack/ http://cracktopc.org/insofta-cover-commander-crack/ http://cracktopc.org/nitro-pro-crack/ http://cracktopc.org/ash-register-pro-crack/ http://cracktopc.org/purevpn-crack/ http://cracktopc.org/ableton-live-suite-crack-2/ http://cracktopc.org/trend-micro-security-crack/ http://cracktopc.org/advanced-systemcare-pro-crack/ http://cracktopc.org/photomagic-studio-crack/ http://cracktopc.org/pdq-deploy-enterprise-crack/ http://cracktopc.org/avg-secure-vpn-crack/ http://cracktopc.org/pdq-deploy-enterprise-crack-2/ http://cracktopc.org/tubemate-downloader-crack/ http://cracktopc.org/winlock-professional-crack/ http://cracktopc.org/vyprvpn-crack/ http://cracktopc.org/daemon-tools-pro-crack/ http://cracktopc.org/digidna-imazing-crack/ http://cracktopc.org/smart-game-booster-crack/ http://cracktopc.org/home-designer-pro-crack/ http://cracktopc.org/clip-studio-paint-ex-crack/ http://cracktopc.org/davinci-resolve-studio-crack/ http://cracktopc.org/spyhunter-crack/ http://cracktopc.org/ef-commander-crack/ http://cracktopc.org/sweet-home-crack/ http://cracktopc.org/iskysoft-data-recovery-crack/ http://cracktopc.org/tableplus-4-9-16-crack-license-key-free-download-2022/ http://cracktopc.org/fxsound-pro-crack/ http://cracktopc.org/bluestacks-crack/ http://cracktopc.org/teamviewer-crack/ http://cracktopc.org/file-scavenger-crack/ http://cracktopc.org/pdf-xchange-editor-crack/ http://cracktopc.org/mackeeper-crack-2/ http://cracktopc.org/youtube-by-click-crack-2/ http://cracktopc.org/netsetman-pro-crack/ http://cracktopc.org/vector-magic-crack/ http://cracktopc.org/bandicut-3-crack/ http://cracktopc.org/clamxav-crack-2/ http://cracktopc.org/mirillis-action-crack-2/ http://cracktopc.org/remo-repair-psd-crack/ http://cracktopc.org/folder-guard-crack/ http://cracktopc.org/wondershare-filmora-crack/ http://cracktopc.org/sandboxie-crack/ http://cracktopc.org/buzzbundle-crack/ http://cracktopc.org/texstudio-crack/ http://cracktopc.org/fineprint-crack/ http://cracktopc.org/itools-crack/ http://cracktopc.org/smartdraw-crack/
CRACKTOPC23 · 5 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: