Some uses of shell SED

#1, replaceReplace 2017 in #将1. txt file with 2016 display on screenSed "s/2017/2016/g" 1.txtReplace 2017 in #将1. txt file with 2016 display to completely modify the file on the screen, plus I modify the fileSed-i "S/2017/2016/g" 1.txt#Sed读取系统变量,

How the shell generates random numbers

Method 1: Use/dev/urandom[[email protected] shell]# tr -dc  "0-9"   Method Two: Use Date +%s Randomly generate a bunch of numbers [Email protected]:/home/dell/shell# date +%s |cksum |cut-d ""-F 1 1934689009Expansion: Randomly generates

"265" Shell file creation link

Advantages: You can run the corresponding *.sh file in other folders, for example, through the putty will default into the folder, you can put the link file there, you can call directly!Method: Very simple1. Right click on the file to create the

Shell prompt Personalization

The specific meaning of the prompt can be consulted: http://billie66.github.io/TLCL/book/zh/chap14.htmlUbuntu16.04 personal configuration as follows, for later review1 functionGit_branch {2branch= "' Git branch 2>/dev/null | grep "^\*" | Sed-e "s/^\*

Shell scripting correlation, floating point, looping

Put a bunch of commands in the script into executable script execution;Script, file name is. SH, get hostname host nameSystem variables:ENV: View System VariablesSet: All variables can be printed with grep andExport path: Define Global variables

Getting Started with Shell scripting--on

Hello everyone! Today's share is the basic knowledge of some shell scripts, chapter for the introduction of the content of this article are: variables (classification, assignment, query, reference), arithmetic operation implementation.Introduction

Linux Common Command Collation (v): Shell Basics

Hello everyone, I'm a singing program, ape ~~~~~~.Recently in the study of Linux, spare time on these basic commands to organize, I hope you can use, the purpose of the finishing is to forget when the turn out to see ^?_?^, before and after a total

Shell practice: Using the For loop to bulk modify file name extensions

Shell practice: Using the For loop to bulk modify file name extensionsDescription: (1) Under Linux batch modify the file name, the command shown in the "_linux" removed.650) this.width=650; "src="

Shell script Instance-Bulk Add user name password

#!/bin/bashread-t 30-p "input name:" Nameread-t 30-p "input number:" num #输入要批量添加的用户数量并将变量赋给numread-t 30-p "input PA ssWOrd: "passif[-N" $name "-a-n" $num "-a-n" $pass "] #判断都不为空theny =$ (echo $num | Sed ' s/^[0-9]//g ') #如果 $num contains 0-9, then

Operations engineers must master the actual shell technology content

All kinds of monitoring scripts, memory, disk, port, URL monitoring alarm How to monitor whether the site directory has been tampered with and how the site directory is recovered after batch tampering How to develop various services

First, the Linux Shell Foundation

1.1. Shell BasicsBash is a language interpreter that is compatible with Bourne Shell and executes commands that are read from standard input device files. BASH is the abbreviation for the Bournae-again shell. Bash is backwards compatible with the

Bash shell-Generic Project Upgrade script

#!/bin/bash################################################################################# Filename:upgrade_ Project.SH# Summary: Project Upgrade Script # LICENSE:GPL # Version:1.0# Author:jet bi# Email:1207501666@qq. com# Date: ./ ,/ ,# Note:

Shell script variables

Shell script variable What is a variableReplace another complex or volatile data with a simple "word"Display and setting of variables: The display of Echo,unset variables Echo ${path}Setting rules for variablesequal sign Connection variable =

Shell Script Rollup 1 Name the backup file by month date

Shell Script Rollup 1 Name the backup file by month date#!/bin/bash# Create a back package for MySQL of the ball and web of ballcloud## backup mysql-ball and web for BALLCLOUDCD /www/web/backup_ballcloud/year= ' Date +%y ' month= ' date +%m ' day= '

Shell automatically checks SSH brute-force IP and blocks attacks

#!/bin/bashlocal_ip= "192.168.0.4" #定义本地IP不会被拒绝tmp_log= ' Mktemp 'Cat/var/log/secure |grep "Failed password for root from" |awk ' {print $11} ' |uniq-c > $tmp _logCat $tmp _log |while Read lineDoAttack_num= ' echo $line |awk ' {print $} 'Attact_ip= '

Shell Programming Examples

1. Create 100 folders in the/home folder. The folder name is a1......a100 in turn.2. Write a script. Own initiative will be under the Household folder under all files less than 5KB package into XX.tar.gz. (Hint: use LS. Grep,find and other orders.

Linux Startup issues BusyBox vx.x.xx built-in shell

This could be a disk detection error, especially after an unsecured shutdown or a damaged disk.Workaround:1. When selecting the startup item, select the first item, such as:Ubuntu 8.04kernl.2.6.22-16-generic2, press E to enter the editing state, in

Shell Find command detailed

Find FilesFind./-type FFind a DirectoryFind./-type DFind a file or directory with the name testFind./-name TestLook for a file whose name matches the regular expression, and note the preceding '. * ' (found file with directory)Find./-regex.

Spark-shell Startup script Interpretation

#!/usr/bin/Envbash## Licensed to the Apache software Foundation (ASF) under one or More# contributor license agreements. See the NOTICEfiledistributed with# this work foradditional information regarding copyright ownership.# the ASF licenses

Shell, CMD, DOS, and scripting language differences and linkages

Issue One: dos differs from windows in cmd On Windows systems, start-run-cmd can open "cmd.exe" for command-line operations. The operating system can be divided into the core (kernel) and shell (shell) two parts, wherein the shell is the operating

Total Pages: 541 1 .... 285 286 287 288 289 .... 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.