All linux commands on android

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Android Shell Command Reference

Clone this wiki locally

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.

Currently this documentation is incomplete, sorry! 

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 dir: permission denied  

The Android shell will run any program it finds in its PATH. The PATH is a colon (':') seperated 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.

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".

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.

$ ls /sbin 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.

Used to apply patches to android files.

Command line audio recorder.

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 
keystore keystore_cli kill 

Send signals to processes.

Used to set up a file system link.

Prints the Android runtime log.

lsmod lsof make_ext4fs mediaserver mkdir 

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 
qemu-props qemud racoon radiooptions reboot 
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.)

Used to administer SQLite databases.

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

Start a shell with root privileges.

#Versions of the Android Shell

  • Android 1.0 used a shell that had no tab completion or history editing.
  • Android 2.3 added history editing. You can for example use the up/down arrows to edit previous commands.

Busybox is a program that contains a shell and a set of command line utilities. Search Android Market for "Busybox" and you should find some versions you can install. The Busybox shell includes tab completion and history editing. Some versions of Busybox for Android do not require that you root your phone.

You can install the full Debian shell and utilities. (Debian is a popular desktop Linux distribution.) I don't know the details, and it may require a "rooted" phone. Try a web search for "Debian Android install".

Some custom ROMs come with their own shells and utilities. If you are using a custom ROM, check its documentation to find out what's available.

Источник

Android Tech on control and test

We've discussed about the Android / Linux Command in separate article. Here, we want to talk about what we can use and where to find the useful commands in Android device. Connect your Android device and launch a command line window in advance. Then you can try to use all these commands by executing command adb shell command_name.

The following commands can be found in the folder "/system/bin/ on Nexus 7.

. ]
or applypatch -c [ . ]
or applypatch -s
or applypatch -l

Filenames may be of the form
MTD:

: : : : .
to specify reading from or writing to an MTD partition.

Help Options:
-?, --help Show help options

usage: adb shell content update --uri [--where ]
is a SQL style where clause in quotes (You have to escape single quotes - see example below).
Example:
# Change "new_setting" secure setting to "newer_value".
adb shell content update --uri content://settings/secure --bind value:s:newer_value --where "name='new_setting'"

usage: adb shell content delete --uri --bind [--bind . ] [--where ]
Example:
# Remove "new_setting" secure setting.
adb shell content delete --uri content://settings/secure --where "name='new_setting'"

usage: adb shell content query --uri [--projection

is a list of colon separated column names and is formatted:
[: . ]
is the order in which rows in the result should be sorted.
Example:
# Select "name" and "value" columns from secure settings where "name" is equal to "new_setting" and sort the result by name in ascending order.
adb shell content query --uri content://settings/secure --projection name:value --where "name='new_setting'" --sort "name ASC"

The following standard options are recognized:
-classpath classpath
-Dproperty=value
-verbose:tag ('gc', 'jni', or 'class')
-ea[:

. |: ]
(-enableassertions, -disableassertions)
-esa
-dsa
(-enablesystemassertions, -disablesystemassertions)
-showversion
-help

The following extended options are recognized:
-Xrunjdwp:
-Xbootclasspath:bootclasspath
-Xcheck:tag (e.g. 'jni')
-XmsN (min heap, must be multiple of 1K, >= 1MB)
-XmxN (max heap, must be multiple of 1K, >= 2MB)
-XssN (stack size, >= 1KB, -Xverify:
-Xrs
-Xint (extended to accept ':portable', ':fast' and ':jit')

These are unique to Dalvik:
-Xzygote
-Xdexopt:
-Xnoquithandler
-Xjnigreflimit:N (must be multiple of 100, >= 200)
-Xjniopts:
-Xjnitrace:substring (eg NativeClass or nativeMethod)
-Xstacktracefile:
-Xgc:[no]precise
-Xgc:[no]preverify
-Xgc:[no]postverify
-Xgc:[no]concurrent
-Xgc:[no]verifycardtable
-XX:+DisableExplicitGC
-X[no]genregmap
-Xverifyopt:[no]checkmon
-Xcheckdexsum
-Xincludeselectedop
-Xjitop:hexopvalue[-endvalue][,hexopvalue[-endvalue]]*
-Xincludeselectedmethod
-Xjitthreshold:decimalvalue
-Xjitblocking
-Xjitmethod:signature[,signature]* (eg Ljava/lang/String\;replace)
-Xjitcheckcg
-Xjitverbose
-Xjitprofile
-Xjitdisableopt
-Xjitsuspendpoll

Configured with: debugger profiler hprof jit(armv7-a) show_exception=1

Dalvik VM init failed (check log file)

Источник

Sysadmin — справочник команд для Linux 1.0.0

Sysadmin — справочник команд для Linux 1.0.0. Скриншот 1 Sysadmin — справочник команд для Linux 1.0.0. Скриншот 2 Sysadmin — справочник команд для Linux 1.0.0. Скриншот 3 Sysadmin — справочник команд для Linux 1.0.0. Скриншот 4 Sysadmin — справочник команд для Linux 1.0.0. Скриншот 5 Sysadmin — справочник команд для Linux 1.0.0. Скриншот 6 Sysadmin — справочник команд для Linux 1.0.0. Скриншот 7

Список команд для терминала в Linux. Все команды Linux здесь объяснены, примеры предоставляются с выводами.

Узнайте, как создавать пользователей и группы и управлять ими, управлять службами и процессами, автоматизировать задачи с помощью заданий cron.

Узнайте, как устанавливать пакеты программного обеспечения с помощью менеджеров пакетов apt-get, yum и rpm.

Установите и настройте серверы FTP, NFS и Samba и безопасно копируйте файлы через Интернет.

Узнайте, как работать с CLI (интерфейс командной строки).

Источник

Читайте также:  Linux посмотреть количество cpu
Оцените статью
Adblock
detector