Get two-day-interval shell script code _linux Shell

Copy Code code as follows: #!/bin/sh # Get the first day of the quarter, the date interval to yesterday # link:www.jb51.net # DATE:2013/2/28 Day= ' date-d "1 days Ago" "+%y%m%d";year= ' expr substr ${day} 1 4 ';Month= ' Expr

Used to record shell scripts that use commands after login _linux shell

Copy Code code as follows: #/bin/bash # History After #把以下代码直接粘贴到/etc/profile user_ip= ' who-u am I 2>/dev/null| awk ' {print $NF} ' |sed-e ' s/[()]//g ' Histdir=/var/log/.hist If [-Z $USER _ip] Then User_ip= ' hostname ' Fi if [!-D

Bash shell in shift usage share _linux shell

Shift can be used to move position parameters to the left.Shell's name is $The first argument is $Second argument $Nth parameter $nAll parameters $@ or $*Number of parameters $# Shift default is shift 1Take the example below: Copy Code code

SED deletes script code for one line of content in a file _linux shell

Take a look at the contents of the original file: Copy Code code as follows: Root@localhost ~]# Cat File.txt Hello World A:b:c-h-N A:b:c-h-N SED deletes related rows based on conditions: Copy Code code as follows:

Shell script to slow down system time (used when testing the server) _linux Shell

The company's recent server testing, the need to constantly adjust the system time, one or two is ok half, a little more points, on a variety of entanglements, the author of these several sets of the author is going crazy. Eldest brother: All speed

Shell script to see the real footprint of process memory _linux Shell

Copy Code code as follows: #!/bin/bash #****************************************************************# # SCRIPTNAME:PM # AUTHOR:OSDBA # Create Date:2010-01-31 # Modify Author: # Modify Date:2010-01-31 # Function:show processes Memory

Shell script Implementation Batch Add user _linux Shell

Copy Code code as follows: useradd.sh #!/bin/bashFor name in Tom Joy John Mark JamesDo Useradd $nameecho "Redhat" | passwd--stdin $nameDone OK, after the execution, the new user will be automatically created Tom, Joy, John, Mark, James,

Linux build (load) dynamic library static libraries and load sample methods _linux Shell

Generation of dynamic libraries: 1,/*mysum.c*/ Copy Code code as follows: #include #include "src.h" int sum (int a,int b){return (A+B);} 2,/*mysum.h*/ Copy Code code as follows: #ifndef __src_h__ #

The shell script _linux shell that retains the specified number of files under Linux under the file system

The content of this section:Keep the specified number of files remaining under the file system Example: Copy Code code as follows: #!/bin/bash #------------------------------- #Description: Back Up your files #site: Www.jb51.net #--

A method for removing intermediate nodes given the middle node pointer of a linked list _linux shell

The problem is as follows Input: Pointer to node C in list A->b->c->d->e Output: no return value, but new list becomes a->b->d->e Answer: Thought for a long time did not think out, read the hint to know the solution. Here's a little trick. To remove

Shell script Implementation installs Jdk_linux shell automatically in Linux system

A: This script runs the machine, LinuxB: The machine that installs the JDK, Linux First, on machine A on which the script runs, determine that you can log on to machine B on the JDK by SSH without a password, and then you can run this script on a:

Shell script implements killing subprocess, zombie process _linux shell

The core server ran a bunch of scripts, procedures, it is inevitable that sometimes zombie process, dead or alive in the occupied resources there, initially just wrote a keyword to kill the process of the Linux shell script, and later found that

Parsing the implementation code of the shell sort _c language

Copy Code code as follows: #include using namespace Std; void Shellqin (int a[],int N) { int GAP=N/2; int i,j; for (; gap>0;gap=gap/2)//Set the initial gap, according to the Gap group, Gap in accordance with GAP/2 decline { After the

Shell script-produced Terminal session playback feature script sharing _linux shell

Not long ago I saw two interesting commands in the book--script and Srciptreplay, which can record a terminal session in a file, that is, we can create a command-line video tutorial through a terminal session, or we can share session files with

Shell implements system time and BIOS time synchronization calibration script sharing _linux Shell

The script is mainly from the defined NTP server list to get the server address to synchronize, if the first unsuccessful, will continue to change the address to sync! Not perfect place also please point out! Copy Code code as follows: #

The shell script implements a gentle way to restart the CentOS system _linux Shell

The main purpose is to restart the background of more important processes, if the use of killall-9 forced kill, may cause problems. such as database processes. The code is as follows: Copy Code code as follows: #!/bin/sh If [-Z "$"];

Summary of array operations in shell and bubble sort implementation script sharing _linux Shell

Shell Array Description: Copy Code code as follows: Array variable definition: $ arr= (1 3 6 8 2 5 9 0 7 4) Get first element by default $ echo $arr By subscript access, the second element of the array below, the shell array

Shell script implements code sharing for copying files to multiple servers _linux shell

In a multiple-machine cluster environment, often faced with the modification of the configuration file after copying to multiple servers, the traditional implementation of the SCP is troublesome, so write the following shell script, you can copy the

A shell script sharing _linux shell that monitors the changes in Linux directories and files

Recently saw a group of people chatting to their server has recently been Hung horse, and then want to use a script to monitor the Web directory changes in real-time files, that is, the directory of additions and deletions to the corresponding log

Shell+linux Command Implementation log Analysis _linux Shell

The IP that lists the most visited times of the daycommand: Copy Code code as follows: Cut-d--F 1/usr/local/apache2/logs/access_log |uniq-c | Sort-rn | Head-20 Principle: Copy Code code as follows:        cut   

Total Pages: 541 1 .... 460 461 462 463 464 .... 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.