&&Command 1 && Command 2: If this command executes successfully && then execute this command.[Jb]/usr/xxxx/ytcclb>ls-l Test.sql-rwxr--r--1 xxxx Group Nov 14:12 Test.sql[JB]/USR/XXXX/YTCCLB>CP test.sql Test.bak && echo "Coping file ok!"Coping file ok!
Reads a file, assigns each row to an array of variables, and prints it out with a for loop
Copy Code code as follows:
#!/bin/sh
I=1
sum= ' sed-n ' $= ' tmp.txt ' #计算文件的总行数
echo "$SUM"
While Read line
Todo
arr[$i]= "$line"
Implementation: SSH remote login, each time to specify a bunch of user names and passwords, is required to implement automatic login.Login process: Local A first log in to B and then log on to the final C
As follows:
Copy Code code as follows:
The following script allows you to convert directories or file uppercase and lowercase letters as follows:
Copy Code code as follows:
#!/bin/sh
#edit by Www.jb51.net
# [: Upper:] [A-z]
# [: Lower:] [A-z]
# [:d igit:] [0-9]
1. Wscript.Shell (Windows Script Host Runtime Library) is an object, and the corresponding file is C:\WINDOWS\system32\ Wshom.ocx,wscript.shell is a component that the server system will use. Shell is the meaning of "shell", this object can perform
Oneself in the VPS do kingate service end, estimated the recent occupancy flow is too big, always be the service provider put my VPS reboot, but kingate this thing is once forced to end, is not boot, because to kingate.pid this file deleted to start,
Today colleagues found that the internal server's hard disk space is not enough, there are many backups, I can not delete, and found a 320g hard disk mounted, want to later the shell script backup to the new hard disk, to make room for the old hard
The TR (translate abbreviation) is used primarily to remove control characters from files or to convert characters.
Syntax: TR [–c/d/s/t] [SET1] [SET2] #SET1: Character Set 1;set2: Character Set 2-c:complement, replace the characters except SET1
When porting JSP pages on Windows to a Linux environment, it is too slow to find a transform encoding and modifying the default encoding type, write this script to attempt file traversal ~
Long time no write, Rusty.
Copy Code code as
The first chapter skips, the bottom starts from the second chapter, everybody understands.PS: Here is a very important thing when my egg hurts, very! Already code article code to the fourth chapter, the tragedy of the wrong browser button to refresh,
1. A streamlined script for automating the deployment of systems, with the main function of cleaning up all directory logs
2. According to the given log directory, delete time combined with crontab to clean the log, clean up after completion, after
Here is a brief description of a bash script that you wrote to detect if a process exists. directly on the code.
Copy Code code as follows:
#!/bin/bash
ps_out= ' Ps-ef | grep $ | Grep-v ' grep ' | Grep-v $ '
result=$ (echo $ps _out |
One of my colleagues once asked me this question: how do I delete all files in the directory except some files under Linux? At the time, I told him that he could solve it by pattern matching. But in fact, besides, there are other methods, which are
First, the script idea
The first step is to rename the log file without having to worry about renaming the log file and losing the log when Nginx is not found. Before you reopen the log file for the original name, Nginx still writes to the file you
The Linux terminal executes to delete the invalid link file.
Copy Code code as follows:
#!/bin/sh
Usage (){echo "Removebroken 0.1, a shell script to remove broken link files."echo "License:mit, (c) Chenzhiqiang"echo "Usage:"echo "$--
Copy Code code as follows:
#!/bin/bash
Path=/bin:/sbin:/usr/bin:/usr/sbin
Export PATH
I=1
While [$i-lt] #硬盘数量, 12 blocks apart from the system disk
Todo
J= ' echo $i |awk ' {printf '%c ', 97+ $i} ' #系统盘是sda, if the other needs to modify
A script to compress the picture, install the #imagemagick# first
Copy Code code as follows:
#!/bin/bash
# yum Install ImageMagick
# Cd/img/dir
for file in */*.jpg; TodoTo_middle_file= "${file%.*}_m.${file##*.}"; FileName plus
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