Common Shell usages

Analyzing Nginx Access Logsawk ' {a[b[$1]++]}end{for (I=length (a); i>0;i--) for (j in B) if (b[j]==i) {c++;if (c ' Www.dwhd.org_nginx.logThe effect is as followsSort statistics in reverse orderCat Access.log| Sort| Uniq -c| Sort 1 -n-rUniq only the

Shell scripts from getting started to complex three (passing parameters)

when executing a Shell script, parameters can be passed to the 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, and 2 is the second parameter that executes

Shell Simple to use

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

Shell Programming (II)

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 scripts-Applications for loops

Array= ('Brand' 'Brandinfo' 'Brandbaojia' 'Vehicletype' 'Brandbaoyang' 'Youhui' 'Config' 'Comment' 'Ownerprice' 'article' 'Usedcar' 'Video' 'MALLGCT' 'Mallimport' 'Baike' 'Machineoil' 'Tire' 'Yanghu' 'Chepin' 'Product' 'Newcar' 'Daogou' 'Tech'

Shell Programming (1)

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

Shell script deny illegal user remote

Deny remote illegal users with SSH brute force login server. Once you enter the password error four times, directly deny the host IP login.The script is as follows: #!/bin/bash#auto Deny SSH error IP#author is Lingshu#2018-04-30#########

In the Shell | Usage

| The operator pipe symbol is a very powerful feature of UNIX, and the symbol is a vertical bar: "|".Usage: Command 1 | Command 2 His function is to pass the result of the first command 1 execution as input of the Command2 to command

How to assign the effect of command execution to a variable like a shell under a bat batch

How do you implement a shell-like command to assign a value to a variable under bat?At first, it was really hard for me. With the familiarity of bat batch knowledge deepened.Learning to!!!Give me a chestnut:Svnlook UUID C:\Repository\test # What do

Linux Experiment 3,shell Programming

/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

Shell Foundation Combat

Learning Environment: Ubuntu  How to view the system version: [# Cat/proc/version]1. For loop Practice  1.1 batch generate random character file name caseExperimental purpose: Generate 10 randomly generated txt text under the/learning path, and the

Shell Learning (iii)

Libvirt Tools for managing the KVM itselfVirt-install installation packages for installing virtual machines, installing virtual machinesVirt-mananger: Managing a tool to create a delete virtual machine---restore content starts---1 Grep-e "SVM | VMX "

Shell Script Basics (vi)

First, alarm system mail engine[[email protected] mon]# lsbin conf log mail shares[[email protected] mon]# cd mail[[email protected] m ail]# vim mail.py//Create send mail script #!/usr/bin/env python#-*-coding:utf-8-*-import os,sysreload (SYS)

Shell Programming--while Loops

Script[[email protected] shell]# vim while2.sh#!/bin/bashi=6while [ $i -gt 0 ]do i=$[$i-1] echo $idoneExecution results[[email protected] shell]# sh while2.sh543210Script[[email protected] shell]# vim while1.sh#!/bin/bashload=`w|head -1|awk -F

Lesson 22nd Basics of Shell

First, Shell introduction1, the shell is a command interpreter, providing users and machines to interact, each user can have their own specific shell,2, CentOS7 default shell for bash, and Zsh,ksh they have the difference in detail,We can check if

8.1 Shell Introduction 8.2 command History 8.3 command completion and alias 8.4 wildcard 8.5 input/output weight

8.1 Shell Introduction: Can be divided into interactive and batch processingInteractive: The user executes a command every input immediatelyBatch: The user writes the full shell script in advance, and the shell executes many commands of the script8.2

Shell Script 3

A variable in a shell script means that the command itself can represent a soft connectionShell variablesParentheses can only affect variables in parentheses because the parentheses open the child shellCurly braces affect variables outside the

First knowledge of SHELL commands

1, shell command commonly known as "shell", it provides a user interface with the kernel to interact with, he accepts the user input command and sends it to the kernel to execute 'The shell is actually a command interpreter that interprets the

Shell Test Judgment command

Judging command testYou can use the test command to perform tests on files, strings, and so on, typically with control statements such as While,if,case"字符串测试" ? test str1==str2 测试字符串是否相等 ? test str1!-str2 测试字符串是否不相等 ? test str1 测试字符串是否不为空 ? test -n

Shell Programming--if Statements

Format 1:if condition; Then statement; FiScript if1.sh[[email protected] shell]# vim if1.sh#/bin/basha=5if [ $a -gt 3 ] then echo okfiExecution results[[email protected] shell]# sh -x if1.sh+ a=5+ ‘[‘ 5 -gt 3 ‘]‘+ echo okokFormat 2:if

Total Pages: 541 1 .... 510 511 512 513 514 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.