FORUMS
Remove All Ads from XDA

[REF]Terminal Emulator Commands ! (Android shell command reference)

2,967 posts
Thanks Meter: 854
 
By nikufellow, Senior Member on 8th November 2012, 09:34 AM
Post Reply Email Thread
15th November 2015, 09:40 PM |#41  
Junior Member
Thanks Meter: 1
 
More
Read and write secure permission
Quote:
Originally Posted by nikufellow

Okay guys the following is a Documentation from 'Jackpal' for his awesome app terminal emulator which helped me a lot in learning various stuff so i thought i'd share it here for some of you who may find it use full !

All credits :Jackpal - See here

Android Shell Command Reference Page History
A "shell" is a program that listens to keyboard input from a user and performs actions as directed by the user. Android devices come with a simple shell program. This shell program is mostly undocumented. Since many people are curious about it I thought I'd write up some documentation for it.


Common problems
The built-in shell has very limited error handling. When you type a command name incorrectly it will say "permission denied", even though the real problem is that it couldn't find the command:


dir: permission denied <---- this is a misleading error message, should say 'dir: not found'

... listing of current directory
The PATH variable
The Android shell will run any program it finds in its PATH. The PATH is a list of directories. You can find out what your shell's PATH is set to by using the built-in echo command:


Depending upon your shell, you may see a different result.

Built in Commands
Every shell has a few built-in commands. Some common built-in commands are:

echo -- prints text to stdout.
set -- sets shell variables
export -- makes shell variables available to command-line programs
cd -- change the current directory.
pwd -- print name of the current directory.

Commands
To find out what commands you have available to you, use the "ls" command on each of the directories in the PATH variable.

Finding documentation for the Android commands.
Many of the Android commands are based on standard Linux (or bsd) commands. If you're curious about a command, you can sometimes learn how it works by using the "man" command on a desktop Linux or OSX (Apple Macintosh) computer. The Linux or OSX version of the command may be different in details, but much of the documentation will still apply to the Android version of the command.

Another source of documentation for people without a Linux or OSX machine handy is to use a web browser and use a web search engine to search for the text: "man Linux command-name".

List of commands
The following is a list of the commands that are present on a Nexus S phone running an Android 2.3.3 "user-debug" build. Many of these commands are not present on a "user" phone. (They are missing from a "user" phone because they are specific to developing or debugging the Android operating system.)


Notice that by default there is no /data/local/bin directory. You can create this directory using the "mkdir" command if you like.


opendir failed, Permission denied
The /sbin directory exists, but you don't have permission to access it. You need root access. If you have a developer phone, or otherwise have root access to your phone you can see what's in this directory.

Notice that the shell prompt changes from a '$' to a '#' to indicate that you have root access.

Notice also that neither of the /sbin commands are useful to the shell -- the adb and ueventd files are 'daemon' programs used to implement the Android Debugger "adb" program that is used by developers.


Vendor/bin is where device vendors can put device-specific executables. These files are from a Nexus S.


This directory does not exist on a Nexus S.


am is the Android Activity Manager. It's used to start and stop Android activities (e.g. applications) from the command line. Type am by itself to get a list of options.

Command line audio file player.


Used to apply patches to android files.


Command line audio recorder.


BlueTooth daemon


Backup manager - type command by itself to get documentation.


Draws the boot animation. You may have to reset your phone to get out of this.


Copy the contents of a file to standard output.


Change the mode of a file (e.g. whether it can be read or written.)


Change the owner of a file.


Compare two files byte-by-byte


The dalvik virtual machine. (Used to run Android applications.)


Prints the current date and time


Convert and copy a file. By default copies standard in to standard out.


Shows how much space is free on different file systems on your device.


Shows the current configuration of network interfaces (IP, MAC address etc)


Shows the current processes using the network interfaces (top, but for networks)

Manage the firewall


Send signals to processes.


Used to set up a file system link.


Prints the Android runtime log.


Lists files.


Make a directory.


A program that sends random events, used to test applications. (Like having a monkey playing with the device.)


Move a file from one directory to another. (Only on the same file system. Use "cat a > b" to copy a file between file systems.


List active processes.


Reboot the device.


Remove a file.


Remove a directory.


Starts the Android runtime.


Stops the Android runtime.


Shows which processes are currently using the most CPU time.

Prints how long your device has been running since it was last booted.


Secure copy program. (Used to copy files over the network.)

Used to administer SQLite databases.


System trace command - use to see what system calls a program makes.


Start a shell with root privileges.

Hi sir . I will be happy if you really help me . I rooted my nexus 5 marshmallow .land installed Android id changer . but it's showing like write secure settings permissions for that app . so please help me to figure it out . thank you
The Following User Says Thank You to vinodrathod For This Useful Post: [ View ] Gift vinodrathod Ad-Free
30th May 2016, 11:17 AM |#42  
BatDroid's Avatar
Senior Member
Look! On the rooftop!
Thanks Meter: 377
 
Donate to Me
More
How to give system write permission?
with chmod.
But how?
what's the command?
15th November 2016, 04:44 AM |#43  
Member
Thanks Meter: 15
 
More
Hi this might be a bit off topic but I am working on my own app and the first command that the app tries to run when i press a button is mount -o rw,remount /system to get mount partition as rw, so i can further execute other commands, however app works fine on other phones but on my phone it shows the following issue in su logs :device or resource busy , can't mount , please help I've tried almost everything, i am able to mount using terminal emulator but not via app
Attached Thumbnails
Click image for larger version

Name:	Screenshot_20161115-090241.png
Views:	940
Size:	73.0 KB
ID:	3937078  
17th December 2018, 11:40 PM |#44  
Member
Thanks Meter: 6
 
More
Need help with sh command. If I miss the subforum, please take me to the right place.
Since I upgrade to Android 9 (Pie) sh command doesn't change network type any more.

I use change network mode to 2g:
su
settings put global
settings put global preferred_network_mode1 1

And (back to Auto 2g/3g/4g):
su
settings put global
settings put global preferred_network_mode1 9

But it doesn't do the trick any more. Commands are executing as root from Tasker.
OP5t OOS
Please help.
16th November 2019, 07:00 AM |#45  
Junior Member
Thanks Meter: 0
 
More
Is there any quick root apps like kingroot out ,I want to root this a10 but my PC is down
16th November 2019, 10:36 AM |#46  
TheRealModder's Avatar
Senior Member
Flag Denpasar, Bali
Thanks Meter: 217
 
Donate to Me
More
Quote:
Originally Posted by CropDustedUrAss

Is there any quick root apps like kingroot out ,I want to root this a10 but my PC is down

Bro, never use quick root apps....
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes