Common Linux shell Script records

Traverse directory where all files are directories or files for file in. /* do if test-f $file then echo $file is the file fi if test-d $file then echo $file is the directory FidoneFilelist= 'ls./Proto 'Echo$filelist

Shell Programming Advanced 1.3data Command

The date command is the command that displays the DateTimeDateFriday, January 01, 2016 15:05:01 CSTThe option to modify the time is-s" 2016-01-01 12:56:10 "View CalendarAa.Annual CalendarCal-yTime to synchronize the serverYum Install Ntp-yNtpdate

Shell Programming Combat 1.1 Introduction to the framework of monitoring ideas

Monitoring ideas, Architecture introductionRequirements: Use the shell to customize a variety of personalized alarm tools, but the need for unified management, standardized management.Idea: Specify a script package that contains the main program,

Shell Programming advanced 1.5 if logic judgment

Logical judgmentif. sh#!/bin/bash### #a=5if3 ]then "a>3" fiif. shA>3Vim if2.sh#!/bin/bash### #a=5if3 ]then "a>3"Fiif 4 ]then "a>4"fiif2. ShSH if2.sh>-ge greater than= =-eq equals! =-ne Not equal to>=-ge greater than or equal toVim

Shell--awk

1. awk command format: awk [Options] File name Options -F FS: Specify delimiter for split data -F File: Specifies the program's script file Example: awk-f: ' {print '} '/etc/passwd Awk–f script/etc/passwd Script: Represents

Shell intercept Log Statistics link count log ip

Get logs by time periodSed-n '/22\/dec\/2015:00/,/22\/dec\/2015:50/p ' localhost_access_log.2015-11-10.txt >/tmp/acc.www.log sed-n '/22\ /dec\/2015:00/,/22\/dec\/2015:50/p ' localhost_access_log.2015-11-10.txt |head-3 sed-n

Building Shell Basic Scripts

Create a simple shell script filePlacing the shell command in a text file requires first using a text editor (VIM)When you create a shell script file, you must specify the shell (#!/bin/bash) to be used in the first line of the fileThe format is:    

Shell script implementation to read the configuration file

(I am participating in the 2015 blog Star Selection, invite you to vote, thank you: HTTP://VOTE.BLOG.CSDN.NET/BLOGSTAR2015/CANDIDATE?USERNAME=ZHOUZXI)Recently, in the process of development work, a requirement was encountered: A shell script was

Some tips in the shell

Bash is currently a more popular type of shell under Linux, and the following are some of the scattered things that are recorded in the learning process. Tidy up for forgetting!1. Transfer of function parameters1) Variables in the script that

Linux Shell Special variables

$: script name, which is the script name entered by the command line$n: Positional parameters, n>0, when n>9, using ${n} form$#: Number of positional parameters"$*": All Positional parameters (single string)[Email protected]: All positional

Shell Common Scripts

Objective Online collection, thank the old boy and the big God, often read their blog and video, script is absolutely their own pure hand, what shortcomings, but also please the Great God guidance. If you feel that there is a violation of the

Shell backup + to determine if the transfer is complete

#!/bin/bash#by lc#dir=/rootdir=/server/scriptsyuanfile=hins423437.tar.gzbakfile=hins423437_xtra_20.*. tar.gzlc  () {  if [  ' ls -l  $DIR |grep  "${bakfile}" |wc -l '  -eq  1 ]  then     duyuan= ' ls -l  $DIR |grep  "${YUANFILE } "|awk  ' {print $5}

Lao Li share: "Linux shell Script Raiders" essentials (eight)

1. Printing process [[email protected] program_test]# PS-E | HeadPID TTY Time CMD1? 00:00:03 Init2? 00:00:00 Kthreadd5 y 00:00:00 migration/06} 00:00:00 ksoftirqd/03 y 00:00:00 migration/04} 00:00:00 watchdog/07? 00:00:00 events/08? 00:00:00 Cgroup9?

Shell Common Small commands

1. Renaming1) Simpler processing command: MV original filename new file namesuch as: MV MyFile newName # # # will myFile renamed to NewName.2) Renaming files command: Rename name_old name_new fileFor example: Rename MyFile newName myfile.text # # # #

Linux Rman Shell

# make direcory for backset file and scripts file,in my Case/backup/db_bakCd/backup/db_bakmkdir Scripts Logs Rman# The following is contents of Rman_backup_shVi/backup/db_bak/scripts/rman_backup_sh#!/bin/bash# author:anbob.com# Desc:rman Backup

Shell Learning notes-conditional judgment

1. Judging the format1) Test parameter fileExample: Test-e/root/install.log2) [parameter file]--Recommended useExample: [-e/root/install.log]Note: Spaces are required after and before the brackets2. determine file type parameters1)-D file: Determine

Shell's Gollum installation + comment

#!/bin/bash#by lcpanduan () {if [ $? -ne 0 ]then  echo  "=========== ====$1 not ok ==================== "  exit 1fi}function checkroot () {   if [  ' Id -u '  -ne 0 ]  then     echo   ' pleases do this  ' su -"'  &&     exit 1   fi}function tarruby (

Note-shell Special variables

Positional variables:$: Gets the file name of the current execution shell, including the script path if the script is executed with a path $n: Gets the n=1..9 parameter value of the currently executing shell script, which represents the file

Getting Started with Shell programming

1.5 Cut command--split fileCut-d:-F 3/ETC/PASSWD take 3rd paragraph1.6 Sort Command--sortSORT-T:-k3/etc/passwd sorted by 3rd paragraph-N Sort by number-R Reverse Order-U Remove Duplicate entries1.7 WC Command-L Calculation of rows-W Computed

Linux Shell Learning notes-compare operations

integer comparison-eq equals, as:if["$a"-eq"$b" ]-ne not equal to, such as:if["$a"-ne"$b" ]-GT greater than, as:if["$a"-gt"$b" ]-ge is greater than or equal to, such as:if["$a"-ge"$b" ]-lt less than, such as:if["$a"-lt"$b" ]-le less than equals,

Total Pages: 541 1 .... 431 432 433 434 435 .... 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.