WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Find doesn't work properly  (Read 4373 times)

Offline JoXo009

  • Full Member
  • ***
  • Posts: 152
Find doesn't work properly
« on: August 31, 2009, 08:16:26 AM »
Don't know if this is normal behaviour, but I feel the following very annoying:

Opening a root terminal in TC
using "cd /" to change to the root
and typing
find -name "*jwm*"
the terminal only shows
./usr/bin/jwm
./usr/bin/jwm_restart
and so on

but
doesn't show hidden files as
./etc/skel/.jwmc
./home/tc/.jwmc-tray

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14848
Re: Find doesn't work properly
« Reply #1 on: August 31, 2009, 08:20:40 AM »
That's probably with busybox find ("find --help" will confirm) - you could try the full version of find from the extension of the same name?

Offline JoXo009

  • Full Member
  • ***
  • Posts: 152
Re: Find doesn't work properly
« Reply #2 on: August 31, 2009, 08:29:37 AM »
Yes, help presents
BusyBox v1.13.4

If there is another version, better working, that would be ok for me.

But I only know that version.

Which extension would I need?

Your findutils or your gtkfind?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Find doesn't work properly
« Reply #3 on: August 31, 2009, 08:33:29 AM »
Findutils would be the one.
The only barriers that can stop you are the ones you create yourself.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14848
Re: Find doesn't work properly
« Reply #4 on: August 31, 2009, 08:35:01 AM »
findutils will give the full version of the find command as opposed to the cut down busybox command.

gtkfind (which requires glib1 and gtk1) will give a gui version of the find command

Offline JoXo009

  • Full Member
  • ***
  • Posts: 152
Re: Find doesn't work properly
« Reply #5 on: August 31, 2009, 08:43:58 AM »
Thanks, problem solved.

I installed both.

Typed find into the terminal - same (poor) result.

Typed gtkfind into the terminal - gtkfind GUI opened
- typed "*jwm*" into the Filename line, clicked wildcard
and both normal and hidden files were shown.

Thank you for your quick help.

postscript:
First reboot and than typing find into the terminal
works too and it's the full version then.

So if you don't need a GUI, findutils is enough,
you just need to reboot before first usage.

« Last Edit: August 31, 2009, 09:05:26 AM by JoXo009 »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14848
Re: Find doesn't work properly
« Reply #6 on: August 31, 2009, 09:03:27 AM »
Typed find into the terminal - same (poor) result.

Maybe "find --help" will shed some light on this?

Offline JoXo009

  • Full Member
  • ***
  • Posts: 152
Re: Find doesn't work properly
« Reply #7 on: August 31, 2009, 09:34:25 AM »
Quote
Maybe "find --help" will shed some light on this?

Unfortunately not, as help underlined that findutils wasn't working.

Result nevertheless corrected, see above postcript.

The explanation didn't mention that findutils needs a reboot before it starts working.


Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: Find doesn't work properly
« Reply #8 on: August 31, 2009, 05:37:35 PM »
Findutils, or any extension that installs to /usr/local/bin that replaces busybox utilities that are in /usr/bin, /usr/sbin, /sbin, /bin should not need a reboot.  However, you will usually need to open a new terminal window to start using the executables in /usr/local/bin without specifying the path.  That is unless there is an issue with the findutils extension.

Offline JoXo009

  • Full Member
  • ***
  • Posts: 152
Re: Find doesn't work properly
« Reply #9 on: September 01, 2009, 02:49:04 AM »
Quote from: Jason W
you will usually need to open a new terminal window
Good to know.

As well as the fact that there is a replacement process giving code in the folder /usr/local/bin greater priority.

Thanks for the info.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14848
Re: Find doesn't work properly
« Reply #10 on: September 01, 2009, 02:58:55 AM »
Good to know.

As well as the fact that there is a replacement process giving code in the folder /usr/local/bin greater priority.

..not exactly a replacement process, the busybox "find" is still there, but /usr/local/bin is ahead of /usr/bin in the default path, so /usr/local/bin/find is found (sic) before /usr/bin/find.

You can display the path using "echo $PATH" and you can see which version of "find" will will run using "which find" .

Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: Find doesn't work properly
« Reply #11 on: September 08, 2009, 01:02:13 AM »
fwiw, it appears to mimick earlier versions

Quote from: find(1)
STANDARDS CONFORMANCE
       The  following  options  are  specified in the POSIX standard (IEEE Std
       1003.1, 2003 Edition):
[...]
       -name  This option is supported, but POSIX conformance depends  on  the
              POSIX  conformance  of the system's fnmatch(3) library function.
              As of findutils-4.2.2, shell metacharacters ('*'.  '?'  or  '[]'
              for  example) will match a leading '.', because IEEE PASC inter-
              pretation 126 requires this.   This is a  change  from  previous
              versions of findutils.

So to find these files with the BusyBox version, something like -name .*jwm* could be used