Linux kernel optimization related shell script

#修改 some of the default configurations in the/etc/sysctl.conf fileif [grep -v "^\s*#" /etc/sysctl.conf|grep -c "net.ipv4.ip_forward\s\+=\+0"];thenCat >>/etc/sysctl.conf Net.ipv4.ip_forward = 0Net.ipv4.tcp_max_tw_buckets = 5000Fs.file-max =

Basic usage of strings in the shell

ObjectiveToday, when writing a script, found that the previous phase used some of the usage is still need to go to Baidu Search, and find the answer also need to filter, delay writing script time, this article on the comparison between the string

Calculate two time difference with Linux shell

1, there are two records in the logID Start time End time0dedffee485e7ddbbff1236cfc0d91 2018-06-28 16:55:37 2018-06-28 16:55:52122dw049dc21b0a7dcdfegeat8c8 2018-06-28 17:21:01 2018-06-28 17:21:23How can I use the Linux shell command to calculate the

Shell Basics (1)

Shell Basics1.shell is the intermediate medium used when the system interacts with the computer hardware, and he is a system tool. If the computer hardware analogy to the human "body", the system kernel is the human "brain", the shell is the "five

Lab Four Shell Programming 2

1. basic usage of shell variables and usage of common symbolsThis section requires writing out the shell commands that implement the requirements , showing(1) Change the main prompt to the user's home directory name( Hint: reference material 4.6.8

Disable and drop cannot be executed in hbase shell

1 Querying work status through the Web monitoring page of HBase discover the regions in transition area has a long-running task, you need to close Hbase-master and restart, and then this problem process I directly use/etc/init.d/ Hbase-master restar

Tomcat multi-instance one-click Deployment Shell Script

#!bin/bash#tomcat deployment script, upload apache-tomcat-8.5.30.tar.gz, jdk-8u172-linux-x64.tar.gz to the server's/tmp/directory in advance. Install Jdktar  -zxf /tmp/jdk-8u172-linux-x64.tar.gz -c /usr/local/ln -s /usr/local/jdk1.8.0_

Shell script: Add new rows to another file

#!/bin/bashCd/usr/local/logstash/nginxlog[-F Num.txt] | | Count=0[-F Num.txt] && count=cat num.txtNcount=wc -l /var/log/nginx/access-app.log | awk ‘{print $1}‘echo $ncount > Num.txtFor ((i= $count +1;iDoNum=$[i]plog=sed -n $num /var/log/nginx/access-

Shell Script Learning (i)

Shell Script Learning (i)A) Introduction to code-style shell scripts    1. Download Xshell 5      Build a folder Mkdri Home/data;1) Look at a 1.sh built in data    See if the build was successful.2) and edit echo Hello Word, and save the launch      

Shell Script Bitwise operation +FOR Loop + return value to undertake

Implementing a certain bit of a register with a shell scriptPit bit 1:Not recognized on the Development Board (Ubuntu can)For ((i=0;iDoDoneInto:For i in ' seq 0 6 'DoDonePit bit 2:return value by default only 8 bits are truncated.Setbits $ $4Regv=$?

Basic monitoring menu written in shell

#!/bin/bashWhile:Doecho "1. View CPU View Memory View Disk View IP Exit Read-p "Please select menu:" ItemIf [${item}-eq 1]; Thenecho "CPU operating frequency is as follows:"Cat/proc/cpuinfo | grep MHRead-p "Enter carriage

centos-shell-Special Characters

Shell wildcard characters# notice is completely different from regular, similar to regular  * any of at least one character ? Any one character  [ ] [] any one of the characters, the relevant character set a-Z 0-9Shell redirection# re-designation of

Shell Programming (III)

Create a script admin.shPerform the following functions:-H | --HELP: Providing Help information--add users: Completing user additions-del User | --delete: Complete User deletion-V: Turn on debug mode, display informationYou can use all of the above

Read of the shell command

read:Brief introduction:The read command reads the value of a variable from the keyboard and is typically used in a shell script to interact with the user. The command can read the values of multiple variables at once, and the variables and input

Shell programming in the 2nd Chapter Introduction to Shell scripts (bottom)

1, SH and./The Difference[email protected] ~]# cat test.shEcho I am thzzc1994[Email protected] ~]# sh test.shI am thzzc1994[Email protected] ~]# bash test.shI am thzzc1994[Email protected] ~]#./test.sh-bash:./test.sh: Insufficient permissionsWant to

Shell script for regular cleanup of log files by "Shell combat"

Function Description: Cleans the Messages history log file (Messages-date) under the/var/log/path, but does not clean the messages file itselfDependency requirements: The BC module is installed on the server1 #clean_logs.sh2 #!/bin/bash3 4 # ========

The Linux shell crawler realizes the tree Cave net automatic reply robot

Odd number of LikesLife is not as good as the ten, but there are no two or three people with the prophets. Fortunately, we were born in the internet era, the reality can not find to talk to people can also be found in the network of emotional vent,

Shell Scripting Basics (eight)

One, expect script synchronization file[[email protected] ~]# cd /usr/local/sbin/[[email protected] sbin]# ls01.expect 02.expect 03.expect check_ng.sh lvs_dr.sh lvs_nat.sh mon nginx_log_rotate.sh[[email protected] sbin]# vim 04.expect

Linux shell string manipulation

Recently in the shell script, found some shell strings of the Sao operation, can improve efficiency.String Read ${var}: Value of variable var ${var-default}: If Var is not declared, the value of Var is $default ${var:-default}: If

Shell Script Programming arrays

Array:Variables: Storing the memory space of a single elementArray: A contiguous memory space that stores multiple elements, equivalent to a collection of multiple variablesArray name and IndexIndex: Numbering starting from 0, which is a numeric

Total Pages: 541 1 .... 398 399 400 401 402 .... 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.