3

I rooted a HTC Wildfire S device recently and flashed an Android 4.1.2 AOKP Jelly Bean Custom ROM. One benefit is that I can use the terminal now.

I'm a little used to using terminal emulators on desktop machines but never did that on an Android device before. I noticed some commands are not found, for example:

$ tree
/system/bin/sh: tree: not found

Is there a way to add more commands to my device, maybe a bundle of GNU packages for Android available somewhere?

  • Lists of items are not generally a good fit for Stack Exchange. If you have a specific problem with concrete answer, please feel free to ask it. – Matthew Read May 26 '13 at 8:52
  • I tried to improve my question. – Afr May 26 '13 at 9:18
2

Yes that's possible with the termux terminal.

Homepage | Google Play

You can install additional shell commands using apt.

$ apt update
$ apt upgrade
$ apt install tree

Screenshot:

using termux

Bonus: Also works on non-rooted devices!

  • 1
    Termux only works on >= Lollipop devices – Caio Lucas Jul 26 '16 at 21:09
1

tree command is not instaled by default. I don't know how to install it in android via terminal but you could allways use the ls command, but yes it doesn't show you a tree format that it is easy to understand, but still does the job.

ls -d */

Only list the directories in the current directory.

ls -ltr

List all files by the time they were last modified in reverse order. In other words the last files listed are the most recently modified files.

I will try and find a way to install the tree package. If i find something I will let you know.

Also install busybox to have more unix command avaible. Reference

1
tree

Isn't even installed on Ubuntu by default.

That said, you can install BusyBox on non CyanogenMod ROMs that lack common utilites. YMMV, but on most "stock" ROMs seem to lack the utilities. AFAIK Busybox doesn't include tree.

ALWAYS DO A BACKUP FIRST!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.