As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [bash]

Bash is a command processor, typically run at the command-line, allowing the user to type commands which cause actions. Bash can also read commands from a file, called a script.

Filter by
Sorted by
Tagged with
0 votes
0 answers
925 views

permission denied only AFTER becoming root (in Termux)

I'm running SuperSu 2.82 (latest) and Termux (latest) on Andriod 7. What is causing the permission denied error below? I get the same error with mount namespace separation turned off (or on) in ...
MountainX's user avatar
  • 617
0 votes
0 answers
147 views

Create and edit a bash script in an USB connected smartphone

The question explains it all. I am using Ubuntu 20.04 LTS. I have connected an android smartphone to pc using USB. Changed directory to internal storage using: cd /run/user/*/gvfs/*/'Internal Shared ...
SuperNoob's user avatar
0 votes
0 answers
291 views

Problem in installation of PrimeOS

When I want to install PrimeOS, I see a black page with a bash like command line instead of choices for choosing. Is it normal? If it is normal, what should I do and type in the page? In all PrimeOS ...
Reza Hosseinzadeh's user avatar
1 vote
1 answer
113 views

Is there a workaround to use of bash via adb on LineageOS17?

I try to login in my device directly vith adb shell bash -i It kind of partially works, because I'm logged with bash, but the terminal loose completion. The error I get: $ adb shell bash -i bash: ...
Gilles Quénot's user avatar
3 votes
1 answer
159 views

Android execute script at logout

I would like to execute a script at logout with my GS7 android 9 (Resurrection Remix). I see that it is advised to use tasker. I guess it is possible to do that without installing a graphical ...
yoarch's user avatar
  • 31
1 vote
0 answers
323 views

Getting "CANNOT LINK EXECUTABLE "inotifywait": library "libnotifytools.so" not found. " when tyring to run a script that uses the inotifywait binary

The script is here: https://github.com/Magisk-Modules-Repo/com.piyushgarg.rclone/blob/master/binary/syncd.sh The code that I do not believe is working is this: while true; do if [[ ! -e ${...
ioo's user avatar
  • 11
0 votes
0 answers
65 views

How to Create batch SYMLinks

I'm installing legacy Termux on an Android 6.0 device. I downloaded the legacy app- and the legacy packages. There is a txt file with all the symlinks that need to be created. I'm looking for a way to ...
Sruly's user avatar
  • 968
2 votes
1 answer
430 views

Android stops/pauses execution of my background script?

Short version: Why is my bash script (running in the background, started via SSHD) not running every ~30 seconds when it should? (NOTE: SSHD and the script are running as root!) I have a script that ...
confetti's user avatar
  • 532
2 votes
1 answer
437 views

SHELL Command works fine as a standalone command, but fails when put into a shell script?

Android 8.1 PIXEL 2 with root access. I have seen this asked here once before but the only solution didn't help me at all. I am going to try and make this as simple as I can for the example. If I ...
Jason Waltz's user avatar
0 votes
0 answers
2k views

rooted device: how to run SSH server persistent even on reboot

I (linux user but not an expert) just moved from iOS to android, my device is rooted (Samsung s9) and I want a ssh server running all the time on my android device (I prefer openssh over dropbear) ...
kuruvi's user avatar
  • 101
0 votes
0 answers
2k views

How to check installed TWRP version?

I’d like to know if there is a way to check what version of TWRP is installed using bash (using a file or command in Android). I could find /persist/.twrps only, which is data file. No command I have ...
tukusejssirs's user avatar
0 votes
1 answer
2k views

Change file (pictures, videos) timestamp from filename

When moving files around tru different dirs and across PC / smartphone, timestamp for last modified date usually get reset to the very datetime of move / copy operation. This lead to files being non-...
Ju Tutt's user avatar
  • 514
1 vote
1 answer
509 views

How to enable/disable lock screen from shell script when a special wifi SSID is present?

My Java skills are low, but I'm mastering shell. Is use LineageOS 14.1 (forked from cyanogenmod). I would like to create a shell script on a rooted devive to enable/disable lockscreen (PIN). I ...
Gilles Quénot's user avatar
1 vote
1 answer
1k views

What are the differences between these adb and fastboot packages?

In my Bash shell, I have the packages: adb vs android-tools-adb as well as fastboot vs android-tools-fastboot. For reference I am trying to root my device, and later use these tools to learn about ...
Deoxal's user avatar
  • 133
-1 votes
1 answer
371 views

Install Bash on Samsung Galaxy Grand Prime+

How to install Bash on Samsung Galaxy Grand Prime+? How to get root permission and install Bash? Thank in advance !
Denny00's user avatar
  • 103
0 votes
2 answers
385 views

Empty variables in termux' bash

I want to perform a test: if a certain variable exists, is non-empty, and its value matches an existing directory, then "exists" should be outputted. I did the following: $ echo $var $ if [ -d $var ...
Josef Klimuk's user avatar
0 votes
0 answers
61 views

Cant manage to mount sdcard on cyanogenmod

So I know that you are not found of cyanogenmod but I don't really know where else could I ask that. So I'm trying to use a classe 10 SD-card which is called "corrupted" when I first insert it. From ...
Baldráni's user avatar
  • 125
1 vote
1 answer
307 views

How to keep an ODROID device connectable via adb?

I'm using an Odroid (rooted) device running Android 5.1.1 on a local network and I'd like to be able to control it via adb. Currently I'm running this at startup: setprop service.adb.tcp.port 5555 ...
George Profenza's user avatar
9 votes
3 answers
10k views

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

I use Termux on my Fairphone 2 and I want to speed up working with it. What slows me down is not having an up arrow key that I can use to access the last command in my bash history. I can do !! !7 and ...
Zanna's user avatar
  • 267
1 vote
1 answer
7k views

Reason for chroot failure: tmp-mksh: chroot: not found

Introduction: I formatted a SDCard in ext4 and copied an ArchVersion on it to run it from Android like in this guide (step 6). Of course my device is rooted and am running the following scripts and ...
goulashsoup's user avatar
0 votes
1 answer
2k views

Addon.d bash script for removing apks after nightly reflash on Android 5.1 CM12.1 not working

I'm trying to have a bash script in /system/addon.d/ that removes unwanted apks from a nightly Android 5.1 (CM12.1) install for my Galaxy Nexus phone. Each new nightly reflash will reinstall some ...
YouKnowNothingJohn's user avatar
1 vote
2 answers
2k views

Backup all apks from device using adb: why this loop in bash script doesn't work?

You can do adb shell pm list packages, and after reading through the list, do an adb shell pm path "com.yourpackage" to get the full path and do a simply adb pull. Fact is: I want to automate this. I ...
Somebody still uses you MS-DOS's user avatar
3 votes
0 answers
631 views

Checking if audio is playing with bash script on Tasker

I have the small script below to check if audio is in use on my Android. if grep -q RUNNING /proc/asound/card*/pcm*/sub*/status; then echo "Playing" ; else echo "Idle"; fi It works nicely in the ...
Claas-Thido Pfaff's user avatar
2 votes
1 answer
1k views

How to make Android Amoled screen to display colours for hardware testing, through commands?

In hardware testing i want to display colours like red, green, blue etc.., on the android screen i.e., Amoled display. Can you help to do this through commands and how the invoke the android display ...
G murali Madhav's user avatar
0 votes
0 answers
590 views

Rooted phone no root access in bash but sh

on cm 12.1 (I know the nightlies) I experienced something very curious. at first, if I start a terminal emulator, I'm not root. I'm just the user the app is running in. so if I do echo $USER it ...
Schwertspize's user avatar
0 votes
1 answer
484 views

Android Tethering - Shell To Python Code (SL4A API)

I know I can convert how I call an activity from within a shell to python code. So given the correct code can someone help me in that conversion? I know I can use pyjinus so that should be another ...
DarkXDroid's user avatar
2 votes
1 answer
403 views

defining functions in TWRP

In "normal" android you start up a Terminal emulator or do "adb shell" and then from there you can defining a function by: function name { #code } name #runs "name" But by using adb shell over TWRP ...
user avatar
0 votes
2 answers
2k views

How to display Python script output on screen, similarly to Conky

I use Conky as a desktop monitoring software. I also use it to monitor stock prices and portfolio net worth through a Python script. Basically, I fetch the stock prices from Yahoo Finance using curl....
Calculus Knight's user avatar
3 votes
3 answers
1k views

Work-around for process substitution in mksh

An extremely useful feature of Bash, known as process substitution, is missing in the Android shell, mksh. This is highly unfortunate as it prevent you from doing things like: diff <(sort list1) &...
not2qubit's user avatar
  • 827
2 votes
1 answer
5k views

How to query/change the default gateway via bash on CM12?

When i do a 'busybox route' on CM12 i get this: localhost / # busybox route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.100.0 * ...
Maniaxx's user avatar
  • 88
0 votes
1 answer
733 views

Error opening terminal: Screen

I just installed nano on my Nexus 9, which is rooted. However, when I try to run nano, it says "Error opening terminal: screen." bash-3.2# nano Error opening terminal: screen. Any help would be ...
user3089196's user avatar
3 votes
1 answer
131 views

How much control can I have over my device while not voiding the warranty?

I'm a developer and a Linux user, so naturally, I want to install a Bash prompt on my device. There are several Bash "apps" available in the Google Play store (haven't tested any of them, just ...
IQAndreas's user avatar
  • 149
0 votes
1 answer
903 views

SH Script to Rename .apk.odex files

I have written a script to utilize dexopt-wrapper to odex a folder of .apk's #!/bin/sh SYSAPP=/mnt/extSdCard/FilesToOdex/system/app/ SYSPRIVAPP=/mnt/extSdCard/FilesToOdex/system/priv-app/ for i1 in ...
Kevin's user avatar
  • 209
2 votes
1 answer
873 views

I can reverse tether now by using alias but it stops on adb shell command

I made some aliases to quickly reverse tether. alias t='r && sh && n' alias n='netcfg rndis0 dhcp' alias sh='ad shell' alias r='ad kill-server && ad start-server' alias ad='...
user42276's user avatar
  • 547
1 vote
1 answer
548 views

Bash-Shell on Android Tablet (Transformer Pad TF701T)

Is there any way to get a fully working bash shell on Android together with a terminal emulator, that supports a hardware keyboard (German Layout)? The features I need at least (Terminal Apps, NOT ...
Tobi's user avatar
  • 213
0 votes
0 answers
1k views

sound alarm from terminal emulator

For my purposes, I want to create a simple bash script, that will notify me when appropriate conditions will meet. Is there a way to make a sound alert from Android Terminal Emulator? I'm running ...
enedil's user avatar
  • 101
6 votes
2 answers
27k views

How do I open a text file from a terminal window from within the Android GUI?

I'm trying to open a text file from within a terminal window emulator -- but not so it opens in the actual terminal but more like I've just clicked on it. So my question is: What command can I use to ...
Richard Lalaz's user avatar
1 vote
4 answers
6k views

Home screen icon for terminal program?

I'm using terminal-ide http://code.google.com/p/terminal-ide/ which is basically a terminal for android with all sorts of utilities. One is able to create bash scripts for example. Is there a way to ...
Fetchinson0234's user avatar
1 vote
1 answer
2k views

Bash terminal on tablets

I would like to buy a tablet and use it as a netbook to work using a keyboard dock (I still like the touchscreen and stylus options over buying a netbook). I work mostly on linux machines where I need ...
madreblu's user avatar
11 votes
2 answers
45k views

adb "Permission denied" to run a "./configure" file

I need to run a configure file into my android phone so I think the best way to do this is to use the adb shell command. I'm running an Android emulator onto a Windows-7 platform, and there I'm ...
grattmandu03's user avatar
8 votes
4 answers
13k views

Running applications from a terminal emulator [closed]

I have a rooted Nexus 7 Jelly Bean tablet and whenever I attempt to run an application from a terminal emulator app after chmod 777ing it and using the syntax ("./applicationName") it insists that I ...
Andrei0427's user avatar
1 vote
0 answers
630 views

Install Bash on rooted Kindle Fire

I just rooted my Kindle Fire and installed QuickSSHd, an SSH daemon app. I can log in via SSH (using Putty in Windows 7) and become root, etc. It appears, however, that the only shell installed is ...
Andrew Lambert's user avatar
12 votes
5 answers
12k views

How to set bash as default shell?

When I adb into a device with Cyanogenmod, I'm presented with a nice bash shell, color prompt, and bashrc. I don't see a symlink from /system/xbin/bash to /system/bin/sh. How do they set the default ...
Ravi's user avatar
  • 221
14 votes
3 answers
17k views

Command to install app from phone?

I'd like to SSH into my phone, download an APK, and install it remotely. Is there a command available on the phone that would allow me to do this? EG: wget localhost/file.apk android_install file....
Naftuli Kay's user avatar
  • 2,552
5 votes
4 answers
2k views

bash - How can I check if a computer exists on my network WITHOUT IP (i.e. by device name only)?

I would like my phone to execute certain shell scripts via Tasker if my phone is on the same wifi network as my laptop. My initial idea is to edit the /etc/hosts file, but this wouldn't work since ...
Dang Khoa's user avatar
  • 253
1 vote
1 answer
3k views

How to modify Bash shell prompt in Cyanogenmod?

Has anyone had any success modifying the shell prompt in Cyanogenmod? Presently, # is pretty useless, it would be much nicer to at least display the working directory. Also, is tab-completion possible?...
Naftuli Kay's user avatar
  • 2,552
5 votes
2 answers
401 views

Is it possible to start an FTP session via bash?

Is it possible to start a session with an Android Samsung Galaxy smartphone through a bash shell to access files remotely?
user avatar