adb Shell common commands:
Press the OK Key device.press (' Keycode_dpad_center ', ' down_and_up ')
Long Press a key: Device.drag ((236,440), (236,440), 2,10)
The corresponding keys correspond to the following names:
HOME key:
$ who can know how many landings on the system$who |wc-l count the number of usersNote: | is a pipe symbol that can be used to establish a pipeline between two programs (pipeline): The WHO output, a WC input, the result of the WC is the number of
Find DocumentsIt is quite convenient to find text in the grep program (matching text matching). There are traditionally three programs that can be used to find entire text files.
grep's oldest text-matching program. The simplest way is to
The shell is an interpretive programming language.The execution of an interpreted script file:When an interpreted script file is executed, the script file is committed to the kernel. The kernel sees the first line of "#! "#! is called when the
1.12 Functions and Parameters
Like other scripting languages, Bash also supports functions and can pass parameters.
1.12.1 function definition and parameter transfer#!/bin/bash function fname () #也可以用fname () instead of {echo $1 , $
Tag:shell function function definition: 1, no return value #function为关键字, function_name for Function name function function_name () {com Mand1 Command2 ...} Omit the keyword FUNCTION, the effect is the same as
Very few shell scripts, recently wrote a shell script, encountered some problems, unexpectedly was tossing for a long while. These errors are too low and should not be. While there is now time, the entire process of executing the shell script is
Menu.sh Menu Interface Script#!/bin/bash#menu. ShFunction menu () {Cat #############################################' Echo-e ' \033[32;40m menu \033[0m "'#############################################* 1) Add a user* 2) Set password for user* 3)
As a system administrator, it is often necessary to periodically clean up certain rules of the file, such as expired logs, expired archives, backed up files, and so on.If you use certain matching rules to find these files and then pass them to the
1. Running a program with parameters$ A indicates the name of the program, which represents the first argument, and the second argument, and so on, until the nineth parameter $9# VI Factorial#!/bin/shf=1for ((i=1;iTest:[Email protected]
$$: The process ID representing the shell script
$!: The process ID representing the last executed shell script
$?: Represents the return value of the last executed shell command
$*: Represents all parameters in the form "parameter one
· CMD in the execution of the shell regardless of · What is the content of, advanced interpretation, and then the interpretation of the final results to the shell, if the result of interpretation is not the shell can command, will be error. However,
Create a thread to refresh the current system timeNew Thread () {public void Run () {Here is another separate thread, not a UI threadDisplay Dis=shell.getdisplay ();while (true) {Non-UI thread access UIif (!shell.isdisposed ())//whether the current
The first few days of the project team out of the shell OJ questions to practice, the topic is about:The existing configuration file Conf.ini as follows, write the shell, enter title and key, output its value,If input FIFO1 a1, then output 11file
#!/bin/bash#shell implementation of the fast sequencing of script programming (with the idea of a meta-point at the far right) a= (8 5 3 2 for 4 1 2 3 + 9 for 8 6) temp=buff= #交换函数swap () {buff=${a[$1]}a[$1]= ${a[$2]}a[$2]= $buff}fun () {i=$ ($1-1)
Under the shell, what do we need to do to write a shell script and then run it;Win, you can write a AutoHotkey script, and then bind the shortcut keys, one click to run.Many tutorials on the web, such
Shell programming notesShell programming:Bash variable type:Environment VariableLocal variable)Location variableSpecial variables (built-in)Local variable:Varname = value: applies to the entire bash process;Variable naming rules:1. It can only
Some common Shell commands
Common system commands]
Passwd [hostname]Change Password
Useradd [hostname]Add User
Su-Switch to the root user
Ssh [hostname]Ssh connection
Cd [directory]Go to the directory
Sudo chown [username]Grant corresponding
Shell script sorting (Bubble Sorting)
#/Bin/basha = (9 84 51 0 345 1 2 34 1 0) # define an array temp = for (I = 0; I
The above is sorted by a custom fixed array, and the following is a user-defined input array.
#/Bin/basha = 'expr $ # + 1' #
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service