Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
49 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-...
1
vote
0answers
68 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 ...
1
vote
1answer
75 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 ...
-1
votes
1answer
115 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 !
0
votes
1answer
115 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 ...
0
votes
1answer
815 views

Moving files with Terminal Emulator on a non-rooted Android

I'm using the Terminal Emulator app on a non-rooted Android 5.0.2 phone. When moving files from a folder of the external SD card to another with: mv /storage/extSdCard/DCIM/Camera/* /storage/...
0
votes
0answers
38 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 ...
1
vote
0answers
113 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 ...
8
votes
3answers
8k 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 ...
1
vote
1answer
5k 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 ...
0
votes
1answer
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 ...
0
votes
2answers
900 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 ...
3
votes
0answers
480 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 ...
2
votes
1answer
765 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 ...
0
votes
0answers
504 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 ...
0
votes
1answer
418 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 ...
2
votes
1answer
354 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 ...
0
votes
1answer
1k 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....
3
votes
3answers
780 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) &...
2
votes
1answer
4k 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 * ...
0
votes
1answer
608 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 ...
3
votes
1answer
117 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 ...
0
votes
1answer
830 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 ...
2
votes
1answer
750 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='...
1
vote
1answer
458 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 ...
0
votes
0answers
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 ...
5
votes
2answers
21k 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 ...
1
vote
4answers
3k 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 ...
1
vote
1answer
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 ...
9
votes
2answers
33k 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 ...
22
votes
6answers
30k views

Is it possible to activate the “USB Tethering” Android setting from the command line?

I would like to activate "USB tethering" from within a bash script, so is there any possibility to run a command line with adb shell to change some Android settings ? Edit1: The following command ...
8
votes
4answers
12k 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 ...
1
vote
0answers
577 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 ...
10
votes
3answers
8k 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 ...
14
votes
3answers
15k 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....
5
votes
4answers
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 ...
1
vote
1answer
2k 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?...
4
votes
2answers
260 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?