How to query the current shell versions and types under the Linux command line

There are several ways to see what shell you are currently using, and the easiest way is to use the shell's special parameters. First, a special parameter named "$$" represents the PID of the shell instance that you are currently running. This

Linux prevents shell scripts from repeating execution

Today, when deployed in Jenkins, because developers frequently submitted code, resulting in Jenkins shell script in that frequent deployment, in order to prevent such problems, a special search to prevent the recurrence of code. Here's a look at the

Shell scripts for Linux admin memcached

If memcached has been installed in Linux and is deployed to the/usr/local/memcached path, next we will begin to install service management scripts for it to start and stop. First of all, through VI in the/ETC/RC.D/INIT.D path to create a new script

Using shell to periodically clean up Web cache data scripts in Linux

After testing, the script does not set up!! The site uses a number of methods to accelerate (REDIS\CDN), this reduces user access to back-end MySQL pressure, as well as the front-end speed is not very good problem, the user requested to all the

Use shell script to configure iptables firewall in Linux

To have a holiday, today is really idle egg pain, originally just want to write a configuration iptables script, did not expect to be so complicated by their own, or to share out to everyone, interested can change their own.PS: This script only

Linux Daemon Automatically restarts shell script sharing

#!/bin/sh #本脚本为守护进程, ,  automatic restart process   Function check_and_kill_and_start () {log_file=$1 If a process zombie is found Name=$2 dead_duration=$3 # echo  "check the progress " $ps _name ymd=$ (date +%Y-%m-%d) Log_file=${log_file}${ymd}.log

Linux shell script to cut large files for a number of small txt files

Workaround: 1. Use split command to cut large files, save 1 million lines per small file Split parameter: -B: The following can be divided into the file size, can add units, such as B, K, m, etc.;-L: Split by number of rows; #按每个文件1000行来分割除

Use shell script to detect memory usage in Linux

The company server has been dying for the last two days because of the full memory usage. Really can't stand the old call room to help people to restart, specifically wrote a script to release the memory, of course, this server is not too important,

Bash vulnerability shell script repair in Linux

The code is as follows Copy Code #/bin/bash #Author Alex Fang. Updates may apply soon. Clear echo "Press AnyKey to continue ..." $anykey; Read AnyKeyecho "bbbbbbbbbbbaaaaaaaaaaaaaaaaaaaasssssssssssssssssshhhhhhhhhhhhhhhhhhhh!"echo

Using Shell to implement batch transform file encoding in Linux

Principle and simplicity: recursion, iconv   code is as follows copy code #!/bin/sh tgt= "Source_rst" Function Fe_convert () {      for file in ' ls $ '     do         if [-D $/' $fi Le]         then        

Shell interaction method for batch change of host name _linux Shell

ssh

Requirements Analysis: 1, SSH Public key copy, provide no password management. 2, batch synchronization hosts files to more than one host. 3. Batch modification of host name. Realize: First edit a Hosts file for synchronization to multiple

A brief summary of the method of using Shell to judge string inclusion relationship _linux Shell

Objective Now every time you analyze the site log, you need to judge Baidu Spider is not the real spider, nslookup after the need to determine whether the results include "Baidu" string Here are some of the methods that are included in the

Java Tuning shell Instance code that can enter parameters

Private Boolean exec (String Cmd, String input[]) { Boolean RC; Try { Porc = Runtime.getruntime (). exec (CMD); pout = new PrintStream (New Bufferedoutputstream (Porc.getoutputstream ())); pin = new DataInputStream (New

Shell to determine whether the script has syntax errors

Determines whether a specified script is a syntax error, and if there is an error, prompts the user to type Q or Q to ignore the error and exit, and any other key can open the specified script via vim;#! /bin/bashScript_file= "./test.sh"Sh-n $script

shell--record an advanced level of personal script

This script is used in the common shell syntax of the work, the trivial grammar together can help to deal with work, liberation of manpower.The main common shell knowledge points: Determine if the parameters exist and determine the number

Generate random numbers in the shell

Command Introduction$RANDOM # #一般产生4-5 digitsColumn description[Email protected] shell]# echo $RANDOM9926[Email protected] shell]# echo $RANDOM16517[Email protected] shell]# echo $RANDOM3839[Email protected] shell]# echo $RANDOM58572. Generate

Shell Scripts split Nginx logs and regularly clean up [do not restart nginx]

The script is as follows:#! /Bin/bash# Nginx access log segmentation shell script# Log DirectoryLog_dir = "/usr/local/nginx/logs /"Cd $ log_dirTime = 'date + % Y % m % d -- date = "-1 day "'# Log Retention daysSave_days = 15# Location where the log

Configure shell script for nginx startup in linux

1. Added the shell script vi/etc/rc. d/init. d/nginx. The code is as follows:Copy code #! /Bin/bash# Chkconfig: 35 85 15# Description: Nginx is an HTTP (S) server, HTTP (S) reverseSet-ePATH

Use shell scripts in linux to cut logs for tomcat and nginx

Online servers generally encounter a variety of log cutting. Similar detailed script articles have not been published before. This time, we will make up for the relevant content of the website. The following describes how to cut two logs, and how to

Nginx log analysis shell script

A few commandsThe script is based on the preceding log format. If your log format is different, you need to adjust the parameters following the awk.Analyze the UserAgent in the log The code is as follows:Copy code Cat access_20130704.log | awk-F

Total Pages: 541 1 .... 303 304 305 306 307 .... 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.