Double quotesPurpose: In order to contain text or function segments. In addition to itself, the function inside the counter-quote, the variable starting with $ and \ Start the inverse of the character outside, the rest are directly output.The
$* is a collection of all incoming parameters for the function (script) where this line command is locatedSimilar to [email protected] without quotes, no differenceThe difference is when the "" is amplified."$*" is treated as a string"[Email
before starting the code, let's take a look at what a shell is. Shell English is also called the shell layer. In a computer, "system" software that "provides user interface", usually refers to the command parser of the command line interface. In
Thank you for the 36,000 sectionCommon Shell Categories:
BASH: is the GNU Bourne Again Shell, which is the default shell on the GNU operating system
C Shell: The BSD version of Sun's shell
Look at where the shell is on the
before starting the code, let's take a look at what a shell is. Shell English is also called the shell layer. In a computer, "system" software that "provides user interface", usually refers to the command parser of the command line interface. In
before starting the code, let's take a look at what a shell is. Shell English is also called the shell layer. In a computer, "system" software that "provides user interface", usually refers to the command parser of the command line interface. In
Shell: Explain the execution of user input commands, row by line interpretation, can also batch many instructions, you can write all these instructions into a script file, let the shell execute multiple commands at once, the common shell (bash, it
In the Iterm2 v3.0 version, there is a new Feature--shell integration, the more important function is to replace the traditional "RZ", "sz" (that is, upload to the server, download files)The specific usage can be found on the website as
#printf命令, format the output statement#用于格式化输出, is the echo-enhanced version, a limited variant of the C-Language printf library function, with slightly different syntax#是由POSIX标准所定义, the transplant is better than echo.#printf不会像echo自动换行, so add \ n
& placed after the startup parameter to set this process as a background processBy default, the process is the foreground process, then the shell is occupied, we can not do other operations, for those who do not interact with the process, many times,
1. Find all files larger than 500M in the current directory, write them into a text file, and count the number of files.Find./-size +500m-type F | Tee File_list | Wc-l2. Locate 100 files starting with ABC in the Directory/TMP and save the first line
A Basic introduction1.awk:Awk is a powerful text analysis tool that is irreplaceable in the processing of text files and generating reports. Awk considers text files to be structured, which defines each input row as a single record, each string in
Generally as long as the Linux installation of the Chinese language pack, you can use English as the default character encoding, you can also recognize Chinese characters, garbled can modify the character encoding settings,Method One: Modify the
1. For loop statements1.1. Syntax Format:For Var in listdo Commandsdonefor ((expression)) do Commandsdone1.2 Simple example:#!/bin/sh# read echo from the direct list "read from direct list" for Var in 1 2 3do echo "$var" Doneecho "\ n"
Using the WC command to count the file lines, the number of words, the number of characters, using sort sorting and de-weight, combined with uniq can be the word frequency statistics.Cat File.txtsort hello.c | uniq-c | Sort-nr |head-5Use cat
1 Case-sensitive UNIX is case-sensitive, so shell scripts are case-sensitive 2 special characters Some characters of Unix have special meanings or functions that must be escaped if they are not used in their special sense (escaped). In order to
Problem Description:In the high-traffic line service, the log system will produce a large number of logs, at all levels of the tens of millions of G. A quick search of logs in such a large file is a problem that ops people often encounter. The
A lot of friends do not know how to use shell scripts to collect information about the Linux system, including CPU, memory, disk, network and other information, here the script to do a small part of the explanation, we come together to see it.First,
The content of this section:Shell string Interception method1, remove the leftmost character of the string[[Email protected] ~]$ VI test.sh1Str="ABCD" 2str=${str#"a"} 3Echo $STR4str=${str%"D"}
Cat/dev/null > FileName Empty file information Trash, the data sent to the secondary file will be deleted. W.H.O. | Wc-l calculating the number of users | (pipeline) can be two more programs between the establishment of a pipeline pipe:who output
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.