As you know, you can use shell to output information to the screen. However, if the output content is too large and redundant, it is not easy for us to analyze and extract the screen information we want, so how can I write shell output into a file?
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
Today, we found that gitbash can be directly opened in shell. gitbash provides some useful Linux-style commands. The most important thing is that you do not need to open another gitbash terminal to manipulate git when using Emacs.
In ~ The
Http://tech.foolpig.com/2008/07/09/linux-shell-char/
Shell string truncation problem:1. Linux Shell intercepts the first eight characters of the character variable by using the following methods:1. expr substr "$ A" 1 82. Echo $ A | awk '{print
Although he does not know who Lu Jun is, his book is indeed easy to understand and has the meaning of training materials..
Linux Shell programming started from UNIX and was presented as a human-computer interaction tool in the early days. After
How to run a script
Three methods:
Absolute path:/tmp/shell. Sh
Relative Path:./shell. Sh
Variable path: Put the directory where the script file is located in path, and then shell. Sh
Below is a simple script
And learn anyProgramming
8 hours reference
Terms
Reference: The selected text is enclosed by some type of reference tag, so that the selected text becomes a text character.
Escape: escape a character means that a backslash (/) is added before the character to escape
List of Common Unix shell commands
Passwd Change User Password PWD print current directory CD change Directory ls list directory file wildcards *,? Any number of characters and a single character file print out the file type cat display
What is shell? Shell is an interface for user interaction with the kernel. It can be used as a command interpreter. After a user inputs a command, shell will explain it and then send it to the kernel for execution,
After knowing what shell is, let
Reprint: http://www.51testing.com /? Uid-225738-action-viewspace-itemid-218002
ShellProcessing
StringMethod (for future reference)
1. Construct a string
Direct Construction
Str_zero = Hello
Str_first = "I Am a string"
Str_second =
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
Write shell code
The following is a shell C program shellcode. C: (this article takes Linux on intelx86 as an example)
Void main (){Char * name [2];
Name [0] = "/bin/sh ";Name [1] = NULL;Execve (name [0], name, null );}
Compile it as the Execution
File Attribute operations in Lesson 5
File attributes include:
1) Permission
2) Owner
3) Group
5.1 file type
5.1.1 determine the file type
To determine the type of a file, you can add the-L option to LS. All types are listed.
For example:
$ LS-L/
The eighth Condition Statement 10.1.1 is a simple if statement $ if 3> 2; then Echo 3; else Echo 2; FI # This is the form of $ cat> test in the command line. sh #! /Bin/shif 3> 2; thenecho 3 elseecho 2fi10. 1.2 use the test format: Test expression
12.3 option analysis in shell script
The first method is to use the case statement for manual processing.
Method 2: Use the getopts command to analyze the options
Syntax format:
Getopts option-string variable
Option-string is a string that contains
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
By learning how to program using the bash scripting language, you can make the daily interaction of Linux more interesting and productive. You can also use the familiar and favorite standard UNIX concepts (such as pipelines and redirection ). In
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