Commands and special symbols in the shell

1. Record the command:!!! : Continuous "! "indicates that the last instruction was executed! N: Represents the second instruction in the execution of the command historyNote:! 2 actually shut me down.! String (string greater than 1) indicates the

Shell uses a small note

The shell is the preferred system administrator for its stability, efficiency and flexibility.1. Shell Introduction:Command line: Refers to the interface for the user to enter a command, which itself simply accepts input and then passes the command

Shell Script Learning (1)

Format:#!/bin/bash: Flag a shell script#Filename: first_shell.sh: File name#auto: echo "Hello Shell": role#by author h0f 2018-03-08: Author-dateecho "Hello Shell": Execute contentExecution: chmod o+x first_shell.sh./first_shell.shOr:/bin/bash

Shell Introductory Learning--1 (draft version)

When we learn is the first to realize that we learn the shell is used to do what, it and other programming languages are different and advantages, do not blindly study, and finally do not know what the purpose of learning shell is to do. Let's start

View Zookeeper cluster status with shell scripts

Zooper Cluster Structure:Host name roleNode1 FollowerNode2 leaderNode3 FollowerMaster ObserverScript content:#!/bin/bashfunction GetStatus () {#定义一个函数EXEC 9<>/dev/tcp/$1/2181 2>/dev/null#打开host的port a read-write socket connection that is connected

Using the shell to do the Nginx log analysis

#!/bin/bashif [[$# = = 0]];thenecho "Error: Please enter the number of days to query???"Elseecho "Temporarily does not support the 7 version of CentOS!!! "now_time_cuo=date +%s((end_time_cuo=${now_time_cuo}- echo $1*3600*24 | bc ))Now_time=date |

One-click installation of Nginx and FSFS Distributed file storage shell scripts

#!/bin/bash# lty 20180116# fastdfs install scriptif [  ' Id -u '  -ne  0 ];then    echo  "Non-root user, script exit"     exit 0fiif  [ ! -f  "/root/soft/fastdfs_install.sh"  ];then    echo  " Reinstall the installation script side after

Shell Exercises (vii)

Exercise 1:Statistics Log size If we need to execute the script you wrote every hour. In the script to implement such a function, when the time is 0 and 12 points, you need to empty the file under directory/data/log/, notice can only empty the

Shell Exercises (ix)

Exercise 1:Find patterns to print numbersRequirements: Please review the rules of the following numbers in detail and use the shell script to output the following 10 digits. 10 31 53 77 105 141 .....Hint: The difference between the two adjacent

Shell Scripting Exercises

Title requirements:Write a script to enter personal information/root/bin/information.sh, the requirements are as follows:1. Prompt the user to enter username (need to check the name of the character, the user name can not be blurred contains any of

Shell Exercises (vi)

Exercise 1:Enter a number to execute the corresponding commandRequirements: Enter a number and then run one of the corresponding commands. The commands shown are as follows: *cmd meau* 1-date 2–ls 3–who 4–pwd; when input 1 o'clock, run date, enter 2

Bulk add users using the shell

Batch Create 10 system accounts (OLDBOY01-OLDBOY10), and set the password (password is random number, the requirement is a mix of characters and numbers)To create a random password:#echo $RANDOM | Cut-c 3-9and write the user name and password to a

Using Shell to develop a springboard machine

Signal list:Common commands related to Linux and signaling are the kill and trap commands, down how to use traps to control the springboard script using the command:Command: Kill-l and Trap-lImportant signal and explanation of Linux system in

Shell Exercises (v)

Exercise 1:Delete the letters in the textRequirements: Delete the line containing the letters in the first 5 lines of a text document and delete all the letters from 6 to 10 lines (file 1.txt, lines greater than 10 lines)Reference Answer:#!/bin/bash#

One shell per day (vii) IP and PV for the statistics site

Using Nginx log file to count all IP and PV, list the top 10 IP, take confluence Knowledge base system as an example:Nginx log file is/var/log/nginx/access.log# wc -l /var/log/nginx/access.log 95146 /var/log/nginx/access.logShell script:# vim

$0, $? In Shell scripts? , $! , $, $ *, $ #, $ @, Etc.

$0, $? In Shell scripts? , $! , $, $ *, $ #, $ @, Etc. $0 indicates the execution name of the program. The file name of the current script $ n indicates the nth parameter value of the program. n = 1 .. 9 $ * all parameters of this program. This

Is the shell script used to determine whether the strings are equal? (Code instance), shell script

Is the shell script used to determine whether the strings are equal? (Code instance), shell scriptShell script to determine whether the strings are equal Basic Elements 1) Declaration of variables 2) Use of if Statements 3) Use of echo 2. The

Shell scripts automatically log on to the server and install JDK (Code tutorial), shelljdk

Shell scripts automatically log on to the server and install JDK (Code tutorial), shelljdk1. Write the installation script Install. sh ! /Bin/bashURL = "https: // ***/jdk-8u161-linux-x64.tar.gz "yum install-y wgetwget $ URLtar-zxvf jdk-8u161-linux-

An example of passing parameters in Shell programming and an example of shell Parameters

An example of passing parameters in Shell programming and an example of shell Parameters When executing a Shell script, we can pass parameters to the script. The parameter format obtained in the script is $ n. N indicates a number. 1 indicates the

Shell programming echo command usage instructions, shell programming echo command

Shell programming echo command usage instructions, shell programming echo command Shell echo commands are similar to PHP echo commands and are used to output values. We can use echo to implement more complex output format control.Show normal

Total Pages: 541 1 .... 438 439 440 441 442 .... 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.