Shell is an interactive command interpreter. Shell is independent of the operating system. This design allows you to flexibly choose the appropriate shell. Shell You can type a command in the command line,After being explained by shell, it is
Shell metacharacters and shell internal variables
Shell metacharacters > Prog> file redirects the standard output to the file> Prog> file: attaches the standard output to the file.| P1 | P2 uses the P1 standard output as the P2 standard
Reprinted: http://blog.csdn.net/zuolongsnail/article/details/8167501
Run ADB shell AM broadcast on the command line to send broadcast notifications.
Parameters following ADB shell AM broadcast include:
[-A ][-D ][-T ][-C [-C ]...][-E | -- es ...
Chapter 2: more structured commands
ForBasic Format
for var in listdo commandsdone
You can specify the list in the following ways:1. List
for var in A B C D
If the listed strings contain special characters, such as single quotes1) Use escape
Find out the difference between for and while, and write out the memo.
Script:
File =/home/hadoop/phrases.txt for content in 'cat $ {file} 'Do phrase = 'echo $ {content}' echo $ phrasedone
The phrases.txt file contains the following content:
1. Eval command-line
Command-new Roman; "> line is a common command line typed on the terminal.HoweverEvalThe result is shell.Scan it twice before executing the command line.For example:
New Roman; "> pipe =" |"
New Roman; "> eval ls $ pipe WC-l
New
Iv. Loop Structure statements
Common shell loop statements include for loop, while loop, and until loop.
ForLoop
Syntax: for variable in list
Do
Operation
Done
Note: The variable is used inside the loop to refer to the object in the List currently
1. view the current system memory usage (free ):
The free command has the following common options:
-B displays data in bytes.
-K displays data in kilobytes (Kb) (default value ).
-M displays data in MB.
-S delay this option will enable
By using the runtime.exe cute method, we can run the Linux Shell script in a Java program or execute other programs. Referring to this article on the Internet: http://lee79.javaeye.com/blog/418549 (thanks), I rearranged the code.The
[Cracked by] layper[Author mailbox] layper2002@yahoo.com.cn[Author's homepage] www.sy135.com[Tools] peid, OD,[Cracking platform] Win9x/NT/2000/XP[Software name] single-step Analysis of Shell and shell chaos (5)[Statement of cracking] I am a cainiao.
Shell may often see: Echo log>/dev/null 2> & 1
Command results can be defined in the form of %>/Dev/null: Indicates an empty device file.>: Indicates the redirection location, for example, Echo "123">/home/123.txt1: Indicates stdout standard output.
1. query the row number of the string.
Grep-n "XXX" str.txt #-N print the prefix of the number of lines where the character "XXX" is located in the file "stringstr.txt"
Example:
Str.txt
XxxYyyZzzXxx
Enter the SEARCH Command: grep-n "XXX"
2. In some software installation processes, you need to create an independent user and then run some installation operations such as gitolite installation, create a git user and execute the installation.
Method 1:sudo -u user ...
Sudo-u Git-H
1. Linux script compiling Basics1.1 Basic syntax IntroductionStart with 1.1.1The program must start with the following line (must begin with the first line of the file ):#! /Bin/shSymbol #! The parameter used to tell the system that the program is
Install and use a peanut shell (Linux). I did this:
First you have to have a peanut shell account, must apply to the http://www.oray.com. Follow these steps.
1. Open the Web http://www.oray.com/peanuthull/download_linux.php In the XP BrowserButton
Use 'grep' to search for text files
If you want to find a string in several text files, you can use the 'grep' command. 'Grep' searches for the specified string in the text. For example, if you are searching for a file with the string 'Magic 'in the'
The memory of the android program is divided into two parts: Native and Dalvik. Dalvik is the Java heap we usually call. The objects we create are allocated here, bitmap is directly allocated on native. The memory limit is that native + Dalvik
Comparison of strings and values in Shell
Binary comparison operator, which compares variables or numbers. Note the difference between numbers and strings.
Integer comparison
-EQ equals to, for example, if ["$ A"-EQ "$ B"]-Ne is not equal to, for
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.