• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

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

Search This thread

nikufellow

Senior Member
May 14, 2012
2,967
843
simcity
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:

$ echo $PATH
/data/local/bin:/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
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.)

$ ls /data/local/bin
/data/local/bin: No such file or directory
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.
$ su
# ls /sbin
ueventd
adbd
# exit
$
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.

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

$ ls /system/sbin
/system/sbin: No such file or directory
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.

app_process
applypatch
Used to apply patches to android files.

Command line audio recorder.

audioloop
bluetoothd
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.

brcm_patchram_plus
bugreport
cat
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.

dhcpcd
dmesg
dnsmasq
dumpstate
dumpsys
dvz
fsck_msdos
gdbserver
getevent
getprop
gzip
hciattach
hd
id
ifconfig
Shows the current configuration of network interfaces (IP, MAC address etc)

Shows the current processes using the network interfaces (top, but for networks)
ime
input
insmod
installd
ioctl
ionice
iptables
Manage the firewall

keystore
keystore_cli
kill
Send signals to processes.

Used to set up a file system link.

Prints the Android runtime log.

Lists files.

lsmod
lsof
make_ext4fs
mediaserver
mkdir
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.

nandread
ndc
netcfg
netd
netstat
newfs_msdos
notify
omx_tests
pand
ping
pm
pppd
printenv
ps
List active processes.

qemu-props
qemud
racoon
radiooptions
reboot
Reboot the device.

record
renice
rild
rm
Remove a file.

Remove a directory.

rmmod
route
rtp_test
run-as
schedtest
schedtop
sdcard
sdptool
sendevent
service
servicemanager
setconsole
setprop
setup_fs
sh
showlease
sleep
smd
stagefright
start
Starts the Android runtime.

Stops the Android runtime.

surfaceflinger
svc
sync
system_server
tc
testid3
toolbox
top
Shows which processes are currently using the most CPU time.
Prints how long your device has been running since it was last booted.

vdc
vmstat
vold
watchprops
wipe
wpa_cli
wpa_supplicant

$ ls /system/xbin
add-property-tag
btool
check-lost+found
dexdump
dhdutil
hcidump
latencytop
librank
opcontrol
oprofiled
procmem
procrank
rawbu
scp
Secure copy program. (Used to copy files over the network.)

showmap
showslab
sqlite3
Used to administer SQLite databases.

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

Start a shell with root privileges.
 
Last edited:

menewtoroot

Senior Member
Oct 6, 2012
1,701
256
delhi
These kind of guides make me feel that just why.???
Why i dont know linux....
I want to know it..
I want to learn it...
I want to do everything that i can do with linux...

Sent from my GT-S5360 using xda premium
 

nikufellow

Senior Member
May 14, 2012
2,967
843
simcity
These kind of guides make me feel that just why.???
Why i dont know linux....
I want to know it..
I want to learn it...
I want to do everything that i can do with linux...

Sent from my GT-S5360 using xda premium


its easy mate just spend a few minutes reading stuff and you'll grab everything!
by the way try Ubuntu 12.04 if you haven't tried yet its the best as of now!
 
  • Like
Reactions: menewtoroot

menewtoroot

Senior Member
Oct 6, 2012
1,701
256
delhi
its easy mate just spend a few minutes reading stuff and you'll grab everything!
by the way try Ubuntu 12.04 if you haven't tried yet its the best as of now!

As i just said...
I am not from linux or ubuntu language...
However after reading this guide i had ask a friend of mine to give me linux disk...
But he is giving me a warning about some kind of hard disk partition...
Nd this is the first thing i dont know about computets ..
So totally:confused:

rooting is new for me...and i am noob to root...:D:D
 

FcukBloat

Senior Member
Jun 18, 2012
6,283
3,012
hi, do you know how to stop a terminal process? I mean, for example if I run logcat, then how can I exit it? in linux I used to press CTRL + C, here in terminal emulator I have to close and reopen the terminal..

also, pressing UP arrow in linux terminals, you see the previous commands you run, is there something similar in android temrinal?

thanks a lot in advance!
 

Deadly

Senior Member
Jul 19, 2012
10,286
3,899
Bangalore
hi, do you know how to stop a terminal process? I mean, for example if I run logcat, then how can I exit it? in linux I used to press CTRL + C, here in terminal emulator I have to close and reopen the terminal..

also, pressing UP arrow in linux terminals, you see the previous commands you run, is there something similar in android temrinal?

thanks a lot in advance!
Click options.. special keys..


uploadfromtaptalk1370597784105.jpg

______________________________________
[APP][2.3+] SpecCheck - Compare Devices Side By Side
 

FcukBloat

Senior Member
Jun 18, 2012
6,283
3,012
a3ujy4eb.jpg
the problem is that I don't have VOL DW + C combo in special keys list! :(

thanks again and sorry for bothering.. :angel::eek:
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 51
    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:

    $ echo $PATH
    /data/local/bin:/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
    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.)

    $ ls /data/local/bin
    /data/local/bin: No such file or directory
    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.
    $ su
    # ls /sbin
    ueventd
    adbd
    # exit
    $
    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.

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

    $ ls /system/sbin
    /system/sbin: No such file or directory
    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.

    app_process
    applypatch
    Used to apply patches to android files.

    Command line audio recorder.

    audioloop
    bluetoothd
    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.

    brcm_patchram_plus
    bugreport
    cat
    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.

    dhcpcd
    dmesg
    dnsmasq
    dumpstate
    dumpsys
    dvz
    fsck_msdos
    gdbserver
    getevent
    getprop
    gzip
    hciattach
    hd
    id
    ifconfig
    Shows the current configuration of network interfaces (IP, MAC address etc)

    Shows the current processes using the network interfaces (top, but for networks)
    ime
    input
    insmod
    installd
    ioctl
    ionice
    iptables
    Manage the firewall

    keystore
    keystore_cli
    kill
    Send signals to processes.

    Used to set up a file system link.

    Prints the Android runtime log.

    Lists files.

    lsmod
    lsof
    make_ext4fs
    mediaserver
    mkdir
    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.

    nandread
    ndc
    netcfg
    netd
    netstat
    newfs_msdos
    notify
    omx_tests
    pand
    ping
    pm
    pppd
    printenv
    ps
    List active processes.

    qemu-props
    qemud
    racoon
    radiooptions
    reboot
    Reboot the device.

    record
    renice
    rild
    rm
    Remove a file.

    Remove a directory.

    rmmod
    route
    rtp_test
    run-as
    schedtest
    schedtop
    sdcard
    sdptool
    sendevent
    service
    servicemanager
    setconsole
    setprop
    setup_fs
    sh
    showlease
    sleep
    smd
    stagefright
    start
    Starts the Android runtime.

    Stops the Android runtime.

    surfaceflinger
    svc
    sync
    system_server
    tc
    testid3
    toolbox
    top
    Shows which processes are currently using the most CPU time.
    Prints how long your device has been running since it was last booted.

    vdc
    vmstat
    vold
    watchprops
    wipe
    wpa_cli
    wpa_supplicant

    $ ls /system/xbin
    add-property-tag
    btool
    check-lost+found
    dexdump
    dhdutil
    hcidump
    latencytop
    librank
    opcontrol
    oprofiled
    procmem
    procrank
    rawbu
    scp
    Secure copy program. (Used to copy files over the network.)

    showmap
    showslab
    sqlite3
    Used to administer SQLite databases.

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

    Start a shell with root privileges.
    4
    Thanks for the quick answer, but i still have a problem :confused:
    (Sry if my questions are kind of stupid, but im new to the commandline) What should the "activity" be as an example??
    I am not getting it work yet.

    Thanks for any answers.
    You can extract any APK and look at the AndroidMainfest.xml.

    Sent from my highly pimped Galaxy Pocket.
    1. Love doesn't need any reason.
    2. Wanna speed up 3G (not 4G LTE)?
    Here it is:
    http://forum.xda-developers.com/showthread.php?t=2586876
    3. My blog
    4. Press the thanks button if I really helped/assisted you.
    2
    Just read a guide on how to dual boot windows and Linux.. you will understand.. still partition.. bit risky for new users..


    Sent from the MUST have app!
    1
    One more thing if you find that this has been already posted here/is useless/unnecessary don't hate me just drop The_captain a PM and it'll be locked before you know it ;)
    1
    Read and write secure permission

    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