-3

I tried to find in Android source code on github, but I didn't find the implementation of the find command any where.

Can some one tell me where it is.

Thanks.

EDIT: An out-of-box Android provides no find command. What is needed is some source code that implements find so that it can be run on Android. Ideally, an answer should give us some source code that may be modified if necessary, but pointers to already compiled binaries are also relevant. Replacement scripts are also welcome.

Useful link: man find (the man page for the find command). Android is a Linux whose command line shell is available via adb shell. Shell script writers usually assume that the find command is available (which is true on most platforms, but not on Android).

EDIT2 (in fact, this should be one of possible answers, but the question is already closed):

A lightweight implementation of find may be found here.

Community
  • 1
  • 1
  • how do you find a file in Linux? you tried to do something like this before? `find / -name xxxyyy.zzz` Is it clearer to you? If you are not sure what it is, please don't downvote me, thanks. –  Sep 18 '12 at 04:06
  • @ViVi I didn't personally downvote you, but your questions wasn't totally clear. I got what you meant, but it could have been worded much better IMO. – Reed Sep 18 '12 at 04:32
  • then can you just give a comment instead of downvoting like that? is it a little impolite? –  Sep 18 '12 at 04:43
  • The description that pops up when you hover on the down vote arrow: "This question does not show any research effort; it is unclear or not useful" I'd say the latter part is an accurate summation of your question. Thus, down voting is not impolite - just honest. Though, I do agree in the case of a down vote, a comment should be provided as well for elaboration. – Reed Sep 18 '12 at 04:50
  • It's a bit harsh to vote down the question to be honest. – Krypton Sep 18 '12 at 05:22
  • 1
    This question is quite clear. People claiming otherwise are simply unfamiliar with the subject matter. – Chris Stratton Jul 24 '14 at 18:19
  • A lightweight implementation of `find` may be found in this shell script: http://stackoverflow.com/questions/4714411/how-to-copy-and-edit-files-in-android-shell/28449946#28449946 – 18446744073709551615 Feb 13 '15 at 12:56
  • 1
    Questions seeking off site resources, such as tools and libraries are off-topic for Stackoverflow. – AdrianHHH Feb 13 '15 at 13:15
  • The code must not necessarily be off-site; for example, http://stackoverflow.com/questions/4714411/how-to-copy-and-edit-files-in-android-shell/28449946#28449946 gives the full source (but serves a bit different purpose). – 18446744073709551615 Feb 13 '15 at 13:24

2 Answers2

2

There's no find command in android.

You can try with busybox.

Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134
-1

I'm going to assume that you understand how to use the Linux find command and you just need help with running a linux command within Android.

Something like Read command output inside su process might help you.

Also, You can use http://code.google.com/p/roottools/ to run command line processes. It simplifies it quite a bit, and you don't actually have to run the processes as root last time I checked.

If I'm totally off on what you wanted, please clarify what you need and I'll do my best to help.

Community
  • 1
  • 1
Reed
  • 14,703
  • 8
  • 66
  • 110
  • 1
    Thanks for your point, but I actually don't need to run it. I want to the implementation of find command. –  Sep 18 '12 at 04:40
  • Still not 100% sure I understand your question. The implementation of the `find` command would be exactly the same as on any linux machine I believe. The difference between other linux machines would be in how it handles command-line input and output in general (i believe). For this, you could just download the entire Android OS source code and see how it is implemented, perhaps. You could also try asking your question on XDA. – Reed Sep 18 '12 at 04:46
  • 1
    As I said, I couldn't find it when I looked into the Android OS source code on github. I would be very pleased if some one can point me to where it is –  Sep 18 '12 at 04:52
  • your answer is totally unrelated to the question – Krypton Sep 18 '12 at 05:45
  • 1
    I would totally down vote this answer if SO would let me. – Reed Apr 07 '15 at 17:10