Results 1 to 7 of 7

Thread: "find -name" ... case INsensitive?

  1. #1
    Join Date
    Jun 2008
    Location
    /earth/europe/uk/england/west-yorkshire/leeds/mystreet/myhouse
    Posts
    248

    Default "find -name" ... case INsensitive?

    Is it possible using the commandline "find" to find fils but without having to enter correct case?

    Example:
    Code:
    bgrsvr-x:/home/badger_fruit/tmpshares # ls tv-series/
    Dexter - Series 3        Simpsons, The - Series 20                           Ugly Betty - Series 3
    Prison Break - Series 4  Terminator, the Sarah Connor Chronicles - Series 2
    Code:
    bgrsvr-x:/home/badger_fruit/tmpshares # find -name "*dexter*"
    finds nothing, but

    Code:
    bgrsvr-x:/home/badger_fruit/tmpshares # find -name "*Dexter*"
    ./tv-series/Dexter - Series 3
    ./tv-series/Dexter - Series 3/Dexter.S03E08.HDTV.XviD-LOL.avi
    ./tv-series/Dexter - Series 3/Dexter.S03E03.HDTV.XviD-NoTV.avi
    ./tv-series/Dexter - Series 3/Dexter.S03E04.HDTV.XviD-0TV.avi
    ./tv-series/Dexter - Series 3/Dexter.S03E07.HDTV.XviD-0TV.avi
    ./tv-series/Dexter - Series 3/Dexter.S03E01.HDTV.XviD-0TV.avi
    ./tv-series/Dexter - Series 3/Dexter.S03E10.HDTV.XviD-0TV.avi
    ./tv-series/Dexter - Series 3/Dexter.S03E06.HDTV.XviD-LOL.avi
    ./tv-series/Dexter - Series 3/Dexter.S03E05.HDTV.XviD-0TV.avi
    ./tv-series/Dexter - Series 3/Dexter.S03E02.HDTV.XviD-0TV.avi
    ./tv-series/Dexter - Series 3/Dexter.S03E11.HDTV.XviD-aAF.avi
    ./tv-series/Dexter - Series 3/Dexter.S03E09.HDTV.XviD-0TV.avi
    bgrsvr-x:/home/badger_fruit/tmpshares #
    finds the files.

  2. #2
    zandro NNTP User

    Default Re: "find -name" ... case INsensitive?

    Quote Originally Posted by badger_fruit View Post
    Is it possible using the commandline "find" to find fils but without having to enter correct case?

    Code:
    bgrsvr-x:/home/badger_fruit/tmpshares # find -name "*dexter*"
    finds nothing
    Code:
    find -iname "*dexter*"

  3. #3
    Join Date
    Jun 2008
    Location
    /earth/europe/uk/england/west-yorkshire/leeds/mystreet/myhouse
    Posts
    248

    Default Re: "find -name" ... case INsensitive?

    Quote Originally Posted by zandro View Post
    Code:
    find -iname "*dexter*"
    D'OH!
    Such an easy thing!!
    HAHA, I tried to read the man pages but there were PAGES and PAGES and PAGES!!!

    Thank you!!!!

  4. #4
    zandro NNTP User

    Default Re: "find -name" ... case INsensitive?

    actually you don't have to _read_ the man page, just hit "/" for search and "n" for next

    also if you're using different locales (i.e. not english) it could help to check the english manpage (though typically thereby you get even more PAGES and PAGES... )

    Code:
    LANG=C man foo

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,158

    Default Re: "find -name" ... case INsensitive?

    And man:find in Konqueror's address bar makes a much more readible document (where searching for 'case' is also very easy).
    Henk van Velden

  6. #6
    Vince NNTP User

    Default Re: "find -name" ... case INsensitive?

    On Wed, 17 Dec 2008 11:46:02 GMT, badger fruit
    <badger_fruit@no-mx.forums.opensuse.org> wrote:

    > bgrsvr-x:/home/badger_fruit/tmpshares # find -name "*dexter*"


    Use iname instead of name


  7. #7
    ab@novell.com NNTP User

    Default Re: "find -name" ... case INsensitive?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    And you could always just have find give you data and then use grep to
    do the finding... which is what I did before learning about 'iname':

    find ./ | grep -i fileNameHere

    Good luck.





    badger fruit wrote:
    > Is it possible using the commandline "find" to find fils but without
    > having to enter correct case?
    >
    > Example:
    >
    > Code:
    > --------------------
    >
    > bgrsvr-x:/home/badger_fruit/tmpshares # ls tv-series/
    > Dexter - Series 3 Simpsons, The - Series 20 Ugly Betty - Series 3
    > Prison Break - Series 4 Terminator, the Sarah Connor Chronicles - Series 2
    >
    > --------------------
    >
    >
    >
    > Code:
    > --------------------
    >
    > bgrsvr-x:/home/badger_fruit/tmpshares # find -name "*dexter*"
    >
    > --------------------
    >
    >
    > finds nothing, but
    >
    >
    > Code:
    > --------------------
    >
    > bgrsvr-x:/home/badger_fruit/tmpshares # find -name "*Dexter*"
    > ./tv-series/Dexter - Series 3
    > ./tv-series/Dexter - Series 3/Dexter.S03E08.HDTV.XviD-LOL.avi
    > ./tv-series/Dexter - Series 3/Dexter.S03E03.HDTV.XviD-NoTV.avi
    > ./tv-series/Dexter - Series 3/Dexter.S03E04.HDTV.XviD-0TV.avi
    > ./tv-series/Dexter - Series 3/Dexter.S03E07.HDTV.XviD-0TV.avi
    > ./tv-series/Dexter - Series 3/Dexter.S03E01.HDTV.XviD-0TV.avi
    > ./tv-series/Dexter - Series 3/Dexter.S03E10.HDTV.XviD-0TV.avi
    > ./tv-series/Dexter - Series 3/Dexter.S03E06.HDTV.XviD-LOL.avi
    > ./tv-series/Dexter - Series 3/Dexter.S03E05.HDTV.XviD-0TV.avi
    > ./tv-series/Dexter - Series 3/Dexter.S03E02.HDTV.XviD-0TV.avi
    > ./tv-series/Dexter - Series 3/Dexter.S03E11.HDTV.XviD-aAF.avi
    > ./tv-series/Dexter - Series 3/Dexter.S03E09.HDTV.XviD-0TV.avi
    > bgrsvr-x:/home/badger_fruit/tmpshares #
    >
    > --------------------
    >
    >
    > finds the files.
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iD8DBQFJSQkn3s42bA80+9kRArMzAJ9tQe8YBrPbF6J1yfqER/17UhJ0UQCfZdgX
    vdCG4JWvkwS36/1kW57gZTs=
    =kEMd
    -----END PGP SIGNATURE-----

Posting Permissions

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