Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8679839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:05:12+00:00 2026-06-12T21:05:12+00:00

I just need to search for a specific directory that can be anywhere is

  • 0

I just need to search for a specific directory that can be anywhere is there a way to run this command until the first match? Thanx!
Im now ussing

find / -noleaf -name 'experiment' -type d | wc -l
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T21:05:15+00:00Added an answer on June 12, 2026 at 9:05 pm

    As Rudolf Mühlbauer mentions, the -quit option tells find to quit. The man page example is that
    find /tmp/foo /tmp/bar -print -quit
    will print only /tmp/foo.

    Slightly more generally, find may be the wrong tool for what you want to do. See man locate. For example, on my system,
    locate experiment | head -3
    produces

    /usr/lib/tc/experimental.dist
    /usr/share/doc/xorg/reference/experimental.html
    /usr/share/doc/xorg/reference/experimental.txt
    

    while locate -r 'experimental..$' produces (with 6 lines snipped for brevity)

    /usr/src/linux-headers-3.2.0-24-generic/include/config/experimental.h
     (snip)
    /usr/src/linux-headers-3.2.0-32-generic/include/config/experimental.h
    

    As noted in ShpielMeister’s comment, the locate database is updated only periodically (eg, daily on Ubuntu Linux systems). When new files are a concern, say sudo updatedb, which in a second or two of work will update the database. Also see: ioflood.com blog about locate command

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to be able to Search a directory and its subdirectories for specific
Just need some quick clarification I have 2 Queries in my Access Database that
Just need a little bit of Javascript to warn people that press the back
I just need to know if WCF is platform independent like Webservices? Can the
I just need to be pointed in the right direction - I can research
I just need to know hot to create a CGLayer that has an image
I need to search the history of a specific file in a git repository
I need a query to search a database for a specific number within a
i've got a website with internal search engine that searches for users with specific
So this question is two parts. The first is seeing whether there is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.