This blog (Http://blog.csdn.net/livelylittlefish) Post the notes prepared by the author (, Xiaoyu) on the relevant research and study content. You are welcome to correct them!
Hide cmd command line running using wscript. Shell object
1. wscript.
A simple example:
#!/bin/bashecho "What's your favourite star?"select var in "Leehom" "Vae" "Jay" "Jolin"; dobreak;doneecho "You have selected $var"
Running result:
root@ubuntu:~# ./star.shWhat's your favourite star?1) Leehom2) Vae3) Jay4) Jolin#
Awk uses shell variables, and shell obtains the variable values in awk.
09:36:28 | category:Linux | font size subscription
Original article: http://renyongjie668.blog.163.com/blog/static/16005312011829102025222/
I think inLinuxLowerAwkIt is a good
Under the current path
Ls-altr
Space and sky are both folders, and the rest are files. The directory structure is as follows:
1. List all folders in the current path
Ls-L | grep ^ d
2. count the number of folders in the
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
Chapter 2: handling user input
Command Line ParametersRead ParametersBASH Shell assigns some special variables called positional parameter to all the parameters entered by the command line.Even include the program name$0: Program name (Absolute
Some terminal shortcut keys:
CTRL + F
Forward one character
CTRL + B
Move one character behind
CTRL + E
Move to end of line
CTRL + L
Clear Screen
CTRL + d
Delete current
1. condition test
Two formats: test condition or [condition] (Note that spaces are added on both sides)Condition can be a logical operation of multiple sub-conditions. The logical operator numbers include:
-A logic and
-O logic or
! Logic No
&, |
2.
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
Import flash. display. Sprite;Import flash. display. stage;Import flash. Events. event;Import flash. Geom. Point; Import zujian. tank; Public class paodan extends Sprite{Private var ball: ball;Private var point: Point = new point ();Private var DX:
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
Is there the same command as NBTSTAT in Linux! View other information through IP: Host Name, Mac, etc.
You can use nmblookup-a ip address.
You can also use nbtscan.
ARP command: ARP iPad. Local or ARP 192.168.1.108 or ARP-A or ARP
VI search string:
Shell script used to detect Processes
10:38:08 | category: centos | font size subscription
Script 1:
#! /Bin/sh
Program = XXXX # process name
Sn = 'ps-Ef | grep $ program | grep-V grep | awk '{print $2} ''# obtain the process port numberIf ["$ {sn}"
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
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. 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
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