Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: find and locate commands return nothing

  1. #1

    Default find and locate commands return nothing

    I've tried (as both root user and regular user) to find files using "find" and "locate" but both return nothing. How do i figure out what's wrong?

  2. #2
    dd NNTP User

    Default Re: find and locate commands return nothing

    On 02/05/2013 06:56 PM, 6tr6tr wrote:
    > "locate" . . . return nothing


    did you install the package findutils-locate with YaST or how?

    did you do that over 24 hours ago?

    if less than 24 hours ago, did you you force the daily cron to run, or
    did you run updatedb before you tried the locate command?

    show us the output of
    Code:
    locate vmlinuz
    --
    dd
    openSUSE®, the "German Engineered Automobile" of operating systems!


  3. #3

    Default Re: find and locate commands return nothing

    And on the 'find' side of thing I'm going to ask basic questions that
    should have been answered already (no offense intended, but you've been
    here a while; if you have not read this, please do so now as it will get
    you better/faster answers:
    http://www.catb.org/~esr/faqs/smart-questions.html )

    Which version of (presumably) openSUSE are you using?
    Where did you run the command?
    Was there anything in the current working directory (as specified by '.')
    to be found via 'find'?
    If you change directories does this help?
    What was the EXACT command/path used? How do you know it "[returned]
    nothing" (worded another way: post your output)?
    Does this work on other systems?
    Why are you running 'find' in the first place (provide the business case,
    please; presumably you're trying to find something, but what and why?)?

    Good luck.

  4. #4

    Default Re: find and locate commands return nothing

    Quote Originally Posted by ab View Post
    And on the 'find' side of thing I'm going to ask basic questions that
    should have been answered already (no offense intended, but you've been
    here a while; if you have not read this, please do so now as it will get
    you better/faster answers:
    How To Ask Questions The Smart Way )

    Which version of (presumably) openSUSE are you using?
    opensuse 12.1

    Quote Originally Posted by ab View Post
    Where did you run the command?
    Tried it in multiple folders both as root and non-root.

    Quote Originally Posted by ab View Post
    Was there anything in the current working directory (as specified by '.')
    Yes.

    Quote Originally Posted by ab View Post
    to be found via 'find'?
    find did not "find" anything despite the files being there.

    Quote Originally Posted by ab View Post
    If you change directories does this help?
    No.

    Quote Originally Posted by ab View Post
    What was the EXACT command/path used? How do you know it "[returned]
    I was in my home directory (and other directories as well after it didn't work). And I first did "ls" to see what was in there and saw the file "testing.txt" so I issued the command:

    Code:
    find -type f -iname "*test*"
    That did nothing.

    Quote Originally Posted by ab View Post
    nothing" (worded another way: post your output)?
    Literally, nothing. It just acted as though I'd hit "enter" after a blank command line. It went to the next prompt but did nothing and printed nothing. There was no output.

    Quote Originally Posted by ab View Post
    Does this work on other systems?
    Yes. And thank you for that question because it helped me discover the problem. For some reason on my current system, it doesn't print out error messages. On another system I entered the same command and it said I needed a path preceeding the search. So I entered it with a "." and suddenly I'm finding stuff!

    So I guess the real problem is why isn't "find" telling me what errors it has?

  5. #5
    dd NNTP User

    Default Re: find and locate commands return nothing

    On 02/05/2013 11:16 PM, 6tr6tr wrote:
    > find -type f -iname "*test*"


    what happens if you just type
    Code:
    find test
    --
    dd

  6. #6

    Default Re: find and locate commands return nothing

    Quote Originally Posted by dd View Post
    On 02/05/2013 11:16 PM, 6tr6tr wrote:
    > find -type f -iname "*test*"


    what happens if you just type
    Code:
    find test
    --
    dd
    It says "find: `test': No such file or directory".

    I get the same issue even if I type "find testing.txt" which is the name of the file in that folder.

  7. #7

    Default Re: find and locate commands return nothing

    Quote Originally Posted by 6tr6tr View Post
    It says "find: `test': No such file or directory".

    I get the same issue even if I type "find testing.txt" which is the name of the file in that folder.
    try with 'find -name tes*'

    that should find testing.txt no matter where you are, in that folder or not, along with all the files starting with tes , if you want the exact name then 'find -name testing.txt'
    Of course, it will search only on that partition.

  8. #8

    Default Re: find and locate commands return nothing

    Quote Originally Posted by gzenum View Post
    try with 'find -name tes*'

    that should find testing.txt no matter where you are, in that folder or not, along with all the files starting with tes , if you want the exact name then 'find -name testing.txt'
    Of course, it will search only on that partition.
    yes, that works.

    Why does -iname not work without a path but -name does?

  9. #9
    dd NNTP User

    Default Re: find and locate commands return nothing

    On 02/06/2013 12:26 AM, 6tr6tr wrote:
    > It says "find: `test': No such file or directory".


    i suspect your system is royally screwed up...how, that happened i don't
    know, but i guess your system administrator needs more self study and
    closer adherence to standard practices..

    --
    dd

  10. #10

    Default Re: find and locate commands return nothing

    gzenum wrote:
    > 6tr6tr;2524882 Wrote:
    >> It says "find: `test': No such file or directory".
    >>
    >> I get the same issue even if I type "find testing.txt" which is the
    >> name of the file in that folder.

    >
    > try with 'find -name tes*'
    >
    > that should find testing.txt no matter where you are, in that folder or
    > not, along with all the files starting with tes , if you want the exact
    > name then 'find -name testing.txt'
    > Of course, it will search only on that partition.


    No. You must quote arguments in the expression, otherwise the shell
    expands wildcards and find never gets to see them.

    FWIW, I never ever run find without an explicit path. Saves figuring out
    various weird ways to go wrong.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •