Have you ever encountered such a situation: from the remote Linux environment of the software, you have compressed a large pile of files into a .tar.gz file, which has not been completed for half an hour in a row. Then, suddenly you are disconnected
Fork
Usage: fork/directory/script. Sh
Fork is the most common. It uses/directory/script. Sh directly in the script to call the script. Sh script.
Run a sub-shell script to execute the call. When Sub-shell is executed, parent-shell is still
[-A file] true if the file exists. [-B file] If the file exists and is a special block file, it is true. [-C file] If the file exists and is a special character file, it is true. [-D file] If the file exists and is a directory, it is true. [-e
I saw a command line prompt from my colleagues on my system (Linux), which had a color and smiling face.
I think it's cool, and I also copied it,
Display Policy: current user, time, current directory,
If a common user displays a smiling face,
The source command can load another script in one script. The following is an example:
First, we define a function script named myfunc. Sh, as follows:
#! /Bin/bashFunction Square{Local tempLet temp = $1*$1The sum of squares of Echo "$1 is: $ Temp"
#/Bin/bash
1, Wildcard
*: Match any character or string, including an empty string.
? : Match any character. For example :?ABCCan match anyABCIt is a string of four characters that can be switched to or from any character.
[…]: Match any single
root@bt:~/test# chgrp --helpUsage: chgrp [OPTION]... GROUP FILE... or: chgrp [OPTION]... --reference=RFILE FILE...Change the group of each FILE to GROUP.With --reference, change the group of each FILE to that of RFILE. -c, --changes like
Assume that the two files file1 and file2 are represented by a and B. The content of file1 is as follows:
A B C E d
The content of file2 is as follows:
C d A C
There are basically two methods: one is the comm command and the other is the
#! /Bin/sh# The first line is to tell the system who will execute this dumb.
$ ## Number of parameters transferred to the script$ # ID of the current process during script running, often used as the suffix of temporary variables, such as haison. $$!
Note: No space is allowed between the left and right sides of "=". The semicolon program 1 # is not required at the end of the bash statement #! /Bin/sh # echo somethingecho "Hello World" Echo "Hello !! "CD/root/export topmkdir./ABC Program 2,
Ls
-L, show the hard link count;
-I, show I-node
-H, human readable
-T, sort by modify time
-S, sort by size
-R, -- reverse
-R, show content of sub-Dir
-V, sort by version
CP
-P,Retain source file attributes, such as the modification time
-L,
1. Glossary:
The following is Wikipedia's explanation:
Here document[1], also known as heredoc, hereis, here-string or here-script, is a shell (such as SH, CSH, KSh, Bash, powershell, and zsh) in the command line) and define a string method in the
Forwarded from blog: http://www.51testing.com /? Uid-390472-action-viewspace-itemid-232903
TimeCommand is used to print the execution time of a command or program.Time
The time, system time, and time used in the execution of a command in
Document directory
Determine whether the file is a device file
Add User:
IP address access statistics:
Calculate the sum of 2 numbers
Text Analysis
File Sorting
Print the swap partition size of the Local Machine
Output the time used to
Lesson 6 variables
Part 2 shell programming
7.1 define variables
Format: Name = value # Note: there cannot be spaces on both sides of the equal sign!
This is different from other scripting languages: value can be defined as a variable value without
14th class hour Functions
14.1 create and use functions
Format: Name () {list ;}
An important feature of Shell functions is that they can be used to replace binary executable files or shell built-in commands with the same name.
For example:
CD () {
The color of the text terminal can be generated using an ANSI unconventional character sequence. Example:
Echo-e "/033 [44; 37; 5 m me/033 [0 m Cool"
The preceding command sets the background color to blue, the foreground color to white, the
My platform: Ubuntu 10.04Solution 1:Lsusb, view the vendorid, and add or modify the 51-android.rules file in the/etc/udev/rules. d/directory.Add a record:Subsystem = "USB", sysfs {idvendor} = "XXXX ",Mode = "0666" where XXXX is the value obtained
In Java, you can call the Execcommand method to run the shell script. The following is an example:
1 .#! /System/bin/sh
2. # The simplest shell with no function
3. # It must be noted that #! Start with/system/bin/sh (with spaces)
4. # different from
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