Reprinted: http://langzhe.iteye.com/blog/671762
Prerequisites: the Erl file must be compiled using the debug_info option. Otherwise, the invalid beam file or no abstract code will appear:Error
Compilation Method: Make: All ([debug_info]). |C
Wget is a command line download tool. Linux users are using it almost every day. The following describes some useful wget tips to help you use wget more efficiently and flexibly.
$ Wget-r-NP-nd http://example.com/packages/
This command
VI editing tool usage:
Common commands:
H, J, K, L correspond to the left, bottom, top, right
CTRL + F flip forward
CTRL + B flip back
0: Move to the first character of this line
G moves to the last row of the file.
N [enter] move the cursor down n
Some shell combinations
CTRL + L: Clear the screen
CTRL + W: delete the word starting at cursorCTRL + u: Clear the line I. e. Delete the all words from Command LineTab: auto-complete files, directory, command names and much moreCTRL + R: search
-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 file: true if the file exists-F file: if the
The shell script was called for half an afternoon .. Shell is really a Nb tool .. Thanks for a space. If you do not enter one space, the space can be adjusted to death ..
1. There are some very strange errors. The error location during execution is
Example 1#! /Bin/shcase ${1 # *. Tar.} In bz2) tar jxvf $1; GZ) tar zxvf $1; *) echo "Wrong file type" esac$1 indicates the first command line parameter ${1 # *. Tar.} when running the script. It indicates that the first command line parameter is
Let's start with an example:
x=1+1echo $x
Are you expecting output 2? Let you down. The output result is 1 + 1. Why? This is because the variable type in shell script is "string" by default, so if the variable type is not specified, 1 + 1 is a
1. Get the return value of Command Execution
?
2. Get the return value of Script Execution
#!/bin/bashecho "A test."exit 0
Echo $ ?, Output: 0
3. Execute programs in the background in Linux
In Windows, use the start command and specify the/B
Shell scripts are similar to the C language and also have a fixed language format. in short, shell scripts are like batch processing files (. BAT), the most basic function is to write a lot of commands together, so that users can easily execute a
Write a script:1. Create a directory/tmp/scripts2. Switch the working directory to this directory.3. Copy the/etc/PAM. d directory to the current directory and run the test command again.4. Change the owner of test and its files and subdirectories
At noon yesterday, after finishing learning ACL and mounting, I tried to write a small script. Suppose a group develops a project and needs to create a project group with three users and a shared folder, to prevent mutual modification or even
Write a script to create and manage LV:Note: During script execution, a menu is displayed to the user, as shown in the following figure:A create an LV.B create an LV in an existing VG.C extend an LV.D reduce an LV.
If you select item A, the
Example 5 insert some content after some strings
[Rocrocket @ rocrocket programming] $ cat mysed.txtBeijingLondon [rocrocket @ rocrocket programming] $ SED's/B. */& 2008/'mysed.txtBeijing2008London
The purpose of this command is to add the following
[Starting text]
Ln is a magic command. It can create a file shadow or enter another place through one channel. :) In fact, all these tricks are implemented through soft connections and hard connections.
Let us assume that you have read the article
In Linux, The SED command is used to replace the text. The command that matches the regular expression can be replaced flexibly with SED, which greatly reduces the workload. It can be said that SED is the main force of replacement in shell scripts
Shell scripts are the core of Linux, while regular expressions are the core of shell scripts. Understanding regular expressions can quickly match the content to be searched, lay a solid foundation for future shell script programming.
The contact
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.