8 useful shell-script sharing

This article mainly introduced 8 practical shell script sharing, this article has given the judgment input number character, the character or other, asks the average, the self decrement output, adds the prefix in the file, the batch test file

Shell scripts periodically empty log files larger than 1G

This article mainly introduces the shell script to empty more than 1G log files, this article directly gives the implementation code, the need for friends can refer to the following A question about how to automatically delete a specified file

Uppercase and lowercase letter conversion shell script code

This article describes a shell script for uppercase and lowercase conversions, learning the use of commands such as TR, awk, and sed. Have a friend in need of reference under The following script allows you to convert directories or file uppercase

Basic use of Shell statements

1 if statement echo "Please input X" Read X echo "Please input Y" Read Y If [$x-gt $y]; In the [] condition, there must be a space before the [only space is followed]. Only a semicolon can be available, or there can be no semicolon Then echo "

How to maintain and clean the notebook shell?

1, teach you to reduce the external appearance of the notebook wear A good notebook how to maintain their own shell, must be a good packaging, and notebook is the same, you need a good quality notebook outsourcing and a soft notebook bag to protect

Multiple ways to perform mathematical operations through the shell _linux shell

In bash, Bash's math is a little awkward, it's hard to adapt and remember, so you have to write a blog post to make it easier to look through. There are four ways to perform mathematical operations: A, let order Copy Code code as follows:

Shell to take today, yesterday, day before yesterday's time operation code _linux shell

1. Take today's time Copy Code code as follows: $date-D "Now" +%y-%m-%d 2. Take yesterday time Copy Code code as follows: $date-D "Yesterday" +%y-%m-%d $date-D "1 days ago" +%y-%m-%d # # D,--date=string

Shell script If Else statement summary _linux Shell

Unlike Java, PHP and other languages, the process control of SH is not NULL, such as: Copy Code code as follows: if (Isset ($_get["Q"])) { Search (q); } else { Doing nothing } ?> You can't write this in Sh/bash,

Bulk Replace Netatalk character set file name with shell script

A period of time before a batch to modify the file name, is a Debian file server, for the Mac to provide file sharing services, the Chinese part of the Use of encoding (check the data, should be, not to actually verify), the specific coding

9-shell Logical operator Knowledge Introduction-Practice and Enterprise case script anatomy

logical operators logical operators used in [] and test logical operators used in [[]] Description -A && And and, both ends are true, then true -O || Or OR, at both ends

Linux shell terminal read-write file data stream and redirect >,<,<<,>>

The terminal realizes the reading and writing of the data stream in the file;The list of REDIRECT commands is as follows: Command Description Command > File Redirects the output to file. Write terminal data

"Shell scripting system monitoring-------Email alerts"

Like many of my classmates, I was confused shell programming before I learned shell programming, but I didn't know what it could do, but I felt I could use a different way to manage the system. Now I slowly understand the importance of the shell for

Add a suffix to the PNG image of the shell script @3x

#!/bin/SHroot_src=$(dirname$ (PWD))Echo${root_src}image_path=${root_src}/ImagesEcho${image_path}#Find${image_path}-name *.png-execEcho {} \;# Find${image_path}-name"*.png"-o-name"*.hhh"-execEcho {} \;# Find${image_path}-regex'*.png\|*.jpg'-execEcho{}

Linux--shell Programming (three) conditional judgment and arithmetic operation

Exercise: Write a scriptDetermine if there is a user's default shell for bash on the current system;If so, the number of such users is displayed, otherwise, no such user is shown;#!/bin/bash#grep '\'/etc/passwd&>/dev/NULLRETVAL=$?if[$RETVAL-eq0];

What "2>&1" means in a Linux shell

You can often see them in a scheduled task. Examples of our company's planning tasks include:*/2 * * * * * root cd/opt/xxxx/test_s1/html/xxxx/admin; PHP index.php task Testone >/dev/null2>&1*/2 * * * * Root cd/opt/xxxx/test _s1/html/xxxx/admin; PHP

8th: Shell script Archiving and compression

Tag: One put BSP compresses rect permissions. GZ mnt gzip8th: Shell script Archiving and compressionRegular backups are not trivial, and we can automate backup through shell scripting. Where data backup is generally used to archive and compression,

Shell Echo-n md5sum How to use

#!/bin/Bashmysql='mysql-u***-p***-hws5 Account'tmp="tmp"Resultsource="Resultsource"resultdest="resultdest"Echo "Select User_id,phone_num,email from user_accounts where length (user_id) = one limit 1"|${mysql} >${tmp}sed '1d'${TMP} >${resultsource}>${

The dollar sign of the shell variable of Linux

The shell variable $# in Linux,[email protected], the meaning of $0,$1,$2 is explainedExcerpt from: Abs_guide The meaning of shell variable $#,[email protected],$0,$1,$2 in Linux is explained:Variable Description:$$The PID of the

Shell scripts for full backup data and differential backup data

#!/bin/bash ## description:  the script function, cycle in weeks; Friday full backup, Saturday No backup, Sunday to Thursday differential backup;#                due to work needs, do not implement compression packaging method, using CP full backup,

Shell scripts to bulk operate Linux hosts:

Shell scripts to bulk operate Linux hosts:I. Introduction to the Environment:Turn on 192.168.100.150-152 (ctos1-3) and 192.168.100.100 (VSFTPD).1.SSH Login: Operate on 192.168.100.1001) Password login 192.168.100.150:SSH [email protected] #

Total Pages: 541 1 .... 73 74 75 76 77 .... 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.