[Email protected] bin]$ sh-n restart.sh[Email protected] bin]$-N: Do not execute script, just check the syntax, if there is no output correctly, if there is an error, you will be prompted[Email protected] bin]$ sh-x restart.sh+
One: Shell Programming basicsShell definition: The shell is a program that acts as an interface between a user and a Linux system. It allows the user to enter commands that need to be executed to the operating system. There are many shells in the
function allows us to divide a complex function into several modules, which makes the program structure clearer and the code reuse more efficient. Like other programming languages, the Shell supports functions as well. The Shell function must first
1. What is Shell
The shell is the user interface of the system and provides an interface (command interpreter) for the user to interact with the kernel. The shell receives the user's input command and feeds it into the kernel to perform the
The case name in the shell under Linux is similar to the switch in C + +, but cases in the shell are more powerful and complex.1, strong mainly reflected in: Shell in case the keyword can be a string type, and each item can contain regular
Shell Scripts (1)a Shell script is a special application that receives the operation commands entered by the user and interprets them, passes the actions that need to be performed to the kernel execution, and outputs the execution results. You can
Hardware Chapter
CPU-related
lscpu #查看的是cpu的统计信息. cat /proc/cpuinfo #查看CPU信息具体信息, such as the model of each CPU, frequency, etc.
Memory-related
free-m #概要查看内存情况 the unit here
+++++++++++++++++++++++++ +++++shell Programming +++++++++++++++++++++++++++++++1. Basic Regular Expressionsregular expressions and wildcard characters:regular expressions are used to match conditional strings in a file, Regex contains matches, grep
Shell Popular Understanding: Translate user-entered commands to the operating system.The Shell is an interactive command interpreter. The shell is independent of the operating system, which gives the user the flexibility to choose the right shell
Basic usage of hbase Shell
Hbase provides a shell terminal for user interaction. Run the hbase shell command to enter the command interface. Run the HELP command to view the help information of the command.
The usage of hbase is demonstrated using
By default, bash shell is a non-typed footfall language. Unless specifically declared with declare, it does not distinguish whether a variable is an integer variable, a floating point variable, or a string variable. All variables in bash shell are
I wrote a shell script to maintain the test environment, used crontab Scheduling for scheduled execution, and encountered a garbled problem. The script runs directly in the shell environment without any questions.
The conclusion is that crontab
1. Event Description:
1 ,#! /Bin/bash
Cat ../ip.txt | while read line
Do
Echo $ line
SSH $ line "ls"
Done
The result is recycled once and then exited. The reason is that while uses the redirection mechanism. All the information in the file is read
Sort command
Sort [Option] [input file]
Option:
-C: Check whether the file has been sorted. If not, output the first unsorted record.
-K specifies the sorting domain
-M merges two sorted files, and the merged files are also sorted, such as sort-M A1
[Shell Study Notes] the sort and uniq commands sort the text, single and repeat the document directory [hide]
Sort command syntax
Common options
Common sort usage
Uniq command
Command Options
Uniq usage
Sort is a commonly
Common shell Command records in Linux and linuxshell commands
Hardware
CPU Problems
Lscpu # view cpu statistics. cat/proc/cpuinfo # view CPU details, such as the Model and clock speed of each CPU.
Memory-related
Free-m # view the memory 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