Shell in the large data domain is an essential tool, how to learn how to use a good shell, start with a simple command
If [-Z "$DIRNAME"] what does this-Z mean?
File operations like this are useful in shell programming: I've summed up some of
The Shuf command can randomly extract different lines of a text file, output to a file or standard output.Shuf usage: Shuf [options] ... [File] or: Shuf-e [Options] ... [Parameters] ... Or: Shuf-I. lo-HI [Options] ... Write a random permutation of
File header#!/bin/shBasic syntax:Define variables:Your_name= "Aivy"In addition to explicitly assigning values directly, you can also assign a value to a variable using a statement: for file in ' ls/etc ' or for file in $ (LS/ETC)The above statement
1#! /bin/Bash2 Test () {3echo "not quoted, same as"4Echo $*5echo [email protected]6echo "Add quotation mark and contrast"7 forN in "$*"8 Do9 Echo $NTen Done One Aecho "----------" - forN in "[email protected]" -
The For loop syntax is structured as follows [[email protected] tmp]# cat 1 . sh # !/bin/bash for i in ' Seq 3 " do echo $i done [[email protected] tmp]# sh 1 . sh 1 2 3 Bulk Modify file name [email protected] tmp]# ll
I. OverviewYou can pass parameters to the script when you execute the Shell script, and the format of the parameters obtained in the script is:$n. n represents a number, 1 is the first argument to execute the script, 2 is the second argument to
The Linux shell can be user-defined functions and can be called casually in shell scripts. Shell functions exist in memory, not hard disk files, so it's fast, and the shell can preprocess functions, so the function starts faster than the script.Note:
First, the history of the command linePress up and down to traverse the most recently entered command after entering incremental modeThis can be viewed in the previous 2000 history$ vim ~/.bash_historySecond, edit the command line
: Delete the
For In loop statement#!/bin/bashfor x in one three Fourdo echo number $xdoneExample: Remove each line in the passwd name and output Hello + name#!/bin/bashlines= ' Wc-l/home/eko/passwd | Cut-d '-f1 ' for I in ' seq 1 $LINES ' Do echo '
Shell Command Application Exercise(1) The use of the following documents is briefly reviewed through the Help information①/ETC/PASSWD (Hint: View this file description description via man 5 passwd)②/etc/shadow (Hint: View this file description
/ETC/PASSWD Purpose: This directory stores the operating system user information, which is visible to all users. Consists of 6 semicolons consisting of 7 information, user name, password (encrypted), UID (user ID), GID Group ID, user's full name or
8.6 Pipe symbol and job controlPipe break: The data from the previous command to be output to the screen as the standard input of the latter commandJob Control: When you run a process, you can use CTRL + Z to pause it, then the FG (foreground)
1. display the 10 processes that consume the most memory/CPU
ps aux | sort -nk +4 | tailps aux | sort -nk +3 | tail
2. view the number of concurrent Apache requests and their TCP connection status
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S)
The following Linux Shell script is used to complete audio accessories for brute force testing. If you have better scripts, please provide them.
-----------------------------------------------------------------------
#! /Bin/sh
While
From: http://www.diybl.com/course/3_program/shell/shelljs/200862/119742.html
A regular expression is a text mode consisting of common characters (such as characters A to Z) and special characters (such as metacharacters. This mode describes one or
1. Configure the vro and go to http: // 192.168.0.1/to start setting.
Select "forwarding rules" -- "virtual server" -- configure as follows, IP address for your local IP Address
Select "forwarding rules" -- "DMZ" host -- configure as follows, IP
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