1. Check out our companion app, Forums for Android! Download from Google Play

Root [HOW-TO] Get bash in Terminal Emulator

Discussion in 'Android Devices' started by EarlyMon, Jul 4, 2012.

  1. EarlyMon

    EarlyMon The PearlyMon
    Thread Starter

    Jun 10, 2010
    New Mexico, USA
    You may already have bash, but if not, this will give you one. Following that, methods are shown to have it as your default shell in Terminal Emulator and deploy a bashrc startup file.

    Please make a nandroid backup before tinkering with this.

    First, download bash from -

    How to cross-compile BASH for Android | Roy Cormier

    If your browser opens a page of gobbletygook, go back, long press the "HERE" link, and choose Save Link.

    It may save as bash-arm.txt or bash-arm.bin with your browser. Use EStrongs File Explorer to rename to just bash-arm without the extension.

    Next, use EStrongs to give you Root Explorer privilege and mount /system r/w for writing.

    Move or copy bash-arm to /system/xbin and then go there and long press the name, Properties, and set permissions to rwxr-xr-x.

    Open Terminal Emulator, enter the following commands exactly -

    cd /system/bin
    ln -s /system/xbin/bash-arm bash

    Go into Terminal Emulator Preferences and set the following command line -

    /system/xbin/bash-arm -

    Set initial command to -

    export PATH=/data/local/bin:$PATH; source /sdcard/bash/bashrc

    Create the bash folder under /sdcard, use EStrongs for that.

    Create the file bashrc in /sdcard/bash and copy/paste the following into it -

    Code (Text):
    2. #!/system/xbin/bash-arm
    4. alias ll="ls -l -a"
    5. alias llm="ls -l -a | more"
    7. PS1="[\w] \$ "
    8. clear
    9. echo "Welcome, bash!"
    Restart Terminal Emulator to see the effect.

    The soft link in /system/bin allows you to enter bash from an adb shell by just entering: bash

    Note that this does not replace your /system/bin/sh like other methods, so it's completely safe and won't break any other Android scripts.

    Enjoy. :)

    Please make a nandroid backup before tinkering with this. ;)

    Consider using with Hackers Keyboard for best results.

    PS - this is entirely my own method, feel free to copy and share. :)


    scary alien and Sepero like this.

Share This Page