30 votes

Termux - How do I create a directory of files accessible outside of Termux?

From within Termux itself, you can change the current directory to the internal storage, by means of cd /storage/emulated/0 or cd /sdcard followed by enter. After that, create a new directory by ...
Grimoire's user avatar
  • 2,969
25 votes

How to return to the home screen with a terminal command?

Actually you can just push the "home" button adb shell input keyevent KEYCODE_HOME KEYCODE_HOME Key code constant: Home key. This key is handled by the framework and is never delivered to ...
Ilya Gazman's user avatar
18 votes

Running own executable on Android shell

First, you have to push it into a directory, such as /data/local/tmp. Then, you have to set permission for that using chmod 755 executable. After that, you can run it as ./executable. Complete steps ...
Koorosh's user avatar
  • 291
18 votes

I'd like to run Termux as root: possible?

The default su from Termux is simple. When run it brings /system/bin/sh for you instead of Termux's shell (typically bash). To solve this issue, you can install the custom su wrapper for Termux by ...
iBug's user avatar
  • 7,747
16 votes
Accepted

Accessing termux user environment from other consoles

Termux does provide the openssh package, which contains both the ssh client and the sshd server. Install the package with: apt install openssh, then start the server with sshd - it will run on port ...
fornwall's user avatar
  • 390
15 votes

No permissions for Termux to access internal storage - even for reading

Following the Termux wiki to run termux-setup-storage fixed it for me, as suggested by fornwall. then restart Termux.
Jensenmann's user avatar
11 votes
Accepted

Run adb command inside the terminal emulator or programmatically without root

Addressing Revision 4 You're still doing things incorrectly even though I noted in revision 1 of my answer that you would need adb in PC for once and once alone as long as no reboot or disabling of ...
Firelord's user avatar
  • 25.1k
8 votes
Accepted

How to access and modify previous commands (bash history) in Termux

See the Termux help page for how to input arrow keys using the VolumeUp button, VolumeDown for Ctrl and some additional shortcuts! Volume Up+W → Up arrow key
fornwall's user avatar
  • 390
7 votes

How to get hardware specs of Android device?

My favorite is the AIDA64 app. I've been purchasing Android boxes (>10 makes/models in last 6 months) and testing/vetting them for friends. Heard the expression, "Mutton dressed like lamb"? It ...
JW_Tech's user avatar
  • 71
6 votes
Accepted

How to turn off screen of android with terminal emulator?

There are two ways of doing this, depending on if you have root or not on your device. If you use root If you have rooted, run: su input keyevent 26 In any good terminal emulator. If you have not ...
Dan Brown's user avatar
  • 1,731
6 votes
Accepted

Run downloaded shell command without root?

Yes, this is by design. You can't execute binaries from the SD card without system or superuser privileges (and remounting it without the noexec option) because otherwise apps could just download and ...
Matthew Read's user avatar
  • 50.6k
6 votes

I'd like to run Termux as root: possible?

I just solved the same problem for myself. tsu didn't work out for me. I found this project: https://github.com/st42/termux-sudo Also I wanted to run sshd as root. It an out of the box with termux-...
kaefert's user avatar
  • 161
6 votes

How to perform a hot reboot using the terminal emulator?

While the other answer correctly states a way to force a (very) soft reboot, I'd like to add some in-depth details (which may not make sense to everyone :). WHAT IS HOT / WARM REBOOT? In order to ...
Irfan Latif's user avatar
  • 20.4k
6 votes
Accepted

How to send all internet traffic to a SOCKS5 proxy server in local network?

The link you have provided is not setting up SOCKS but a transparent proxy i.e. it takes TCP/UDP traffic and SOCKSify it before sending through shadowsocks tunnel. But you need to make your traffic ...
Irfan Latif's user avatar
  • 20.4k
5 votes

Run downloaded shell command without root?

Android, just as Linux, prevents any user but root, to change the permission bits of any file not owned by such user. That said, chmod is ineffective, unless you have root privileges. By the way, ...
Grimoire's user avatar
  • 2,969
5 votes

Downloading and installing the DEBIAN ARM packages and installing them on Termux?

Termux's repository of ARM packages can be found at: termux.net/dists/stable/main/binary-arm/ Additional resources that may be of interest: Termux Help: Package Management Termux Help: Termux and ...
Andy's user avatar
  • 147
5 votes

No permissions for Termux to access internal storage - even for reading

Newer versions of Android require apps to ask for permission during runtime. You may have noticed this already. One example is Chrome asking for the Storage permission when you try to download ...
ColinTNMP's user avatar
5 votes
Accepted

How to run "parted" command in terminal emulator on my android smartphone

Note: This is applicable to Qualcomm SoC with eMMC (block device accessible through FTL). Not tested on MTK or other chipsets (paths may differ) or the devices with raw NAND/MTD memory. PARTED How ...
Irfan Latif's user avatar
  • 20.4k
5 votes

How to do GREP text searching without root?

You are mixing up two things: Installing a binary like busybox system wide from within an app (which includes grep) Running a binary The default app based installers for busybox require root access ...
Robert's user avatar
  • 20.2k
4 votes
Accepted

How to write Android shell history to file?

mksh developer here. We disabled persistent history for mksh on Android, in order to not tax the flash memory with too many write requests. You can re-enable it in a custom ROM by setting -...
mirabilos's user avatar
  • 663
4 votes

Can a Terminal Emulator on android do everything that a terminal on linux or mac does?

Not really.... they are no more limited than the tools that Android has installed, remember that Android is not Linux, it is based on it but it's command line interface is very limited by comparison ...
acejavelin's user avatar
  • 6,207
4 votes

Package manager for android terminal

No. There are some projects to port Debian apt but they were unusably unstable last I tested. 2018 update Termux is reliable and can install select packages (I use ssh/rsync), more packages are ...
user1133275's user avatar
4 votes

which termux package provides the "mount" command?

Either type /system/bin/mount manually or create a shortcut by ln -s /system/bin/mount $PREFIX/bin/mount so that you can access it more easily later. Don't bother with toolbox or toybox. ...
iBug's user avatar
  • 7,747
4 votes

How to save files to external SD card on a non-rooted Android?

Filesystem level write access to physically external SD card without rooting phone is not possible since pre-KK days. However apps can always (with or without Storage permission) read and write to ...
Irfan Latif's user avatar
  • 20.4k
4 votes

Immersive mode in Termux?

I could have sworn immersive mode was a feature of Termux... You can still use immersive mode via ADB (or root, if you have that). Hide both status and navigation bar: adb shell settings put global ...
SSS's user avatar
  • 499
4 votes
Accepted

How to change font scale from Terminal

This answer from StackOverflow (How to change font size by adb command) provides a solution. The command used to set the font size is: adb shell settings put system font_scale {...
Reddy Lutonadio's user avatar
4 votes

What sepolicy context will allow any other context to access it?

ROOT USER AND SELINUX: User root (with UID 0) is the super user in Discretionary Access Control (DAC) implementation of *NIX operating systems. DAC is allowed by-default i.e. anyone can access ...
Irfan Latif's user avatar
  • 20.4k
4 votes
Accepted

How can run native executables compiled for ARM on unrooted Android devices?

In addition to noexec mount option, /sdcard is emulated filesystem with fixed file permissions. So files can't be set executable. But some file explorers like MiXplorer support executing binaries/...
Irfan Latif's user avatar
  • 20.4k
4 votes

Check IP details via Android Terminal App in Android 13

Google has removed the possibility to bind netlink socket to retrieve arp table from targetSdkVersion 30 through SELinux policies. If you have root, you can disable SELinux policies and it will work, ...
fulvius31's user avatar
3 votes

When using a terminal emulator, why are there so many normal Linux commands that do not work?

This is not Bash. At the beginning of my journey in Android, I have seen that the Android shell is a little bit different from Bash. The Android Shell A "shell" is a program that listens to ...
Darleison Rodrigues's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible