Linux Shell Set__linux

SET Command The set command acts primarily to display shell variables that already exist in the system, and to set new variable values for shell variables. When you use set to change shell attributes, the function of the symbol "+" and "-" is to

Linux enables fast switching between JDK versions via shell scripts __linux

"Lead" on the Android website, the installation part of the JDK has the following requirements: The Master branch of Android in the Android Open source project (AOSP) needs to use Java 8, and OpenJDK is needed in Ubuntu. For a lower version, refer

Writing shell programs on Linux and executing __linux

to write a shell program in Linux and perform the steps Brief Introduction I am the first time to write a blog, do not know what should be the format and precautions, please advise. Today is about how to create a script and run it in a Linux

Linux shell script periodically cleans Tomcat log files (first draft) __linux

Shell script to clean up logs ------------------------------------------------------------------------------------------------ #!/bin/bash tomcatnum=2 #清理的路径 tomcat[0]= "/usr/local/tomcat/logs"tomcat[1]= "/data/logs/tomcat0"For ((i=0;iecho "Deleting

Batch execution of the same command shell script on a Linux cluster __linux

Execute the same command on multiple machines on a cluster because of actual development needs. For example, execute a specified script, delete files in the same directory (this is prudent ~ ~) and so on, the members of the group developed a ALLSCP (

Linux Shell Basic Operations __linux

~ Represents the current user's root directory/home/username/ /represents all the root directory . Represents the current directory Copy files:1. Copy Local files to remoteSCP filename User name @ computer IP: remote path2. Copy files back to local

Linux Shell date, time related commands __linux

In shell development, it's often used to date-related things, and here's how the Linux shell gets the date. Get the current date: today= ' date +%y-%m-%d ' Get yesterday's date: yesterday= ' date-d '-1 day ' + '%y-%m-%d ' Get the date of N days

Methods for reading file contents in Linux shell scripts (including efficiency testing) __linux

This paper mainly introduces the 4 methods of the shell reading files by line: While loop method, redirect method, pipeline method, file descriptor method. method 1:while The most efficient and commonly used method in the loop. The code is as

Shell Common script Comparison

-B Returns True when file exists and is a block file -C Returns True when file exists and is a character file -D returns True when pathname exists and is a directory -E Returns True when pathname specified file or directory exists -F Returns True

Linux-shell command chgrp Change Group __linux

Feature Description: change the group to which the file or directory belongs. Syntax Description:chgrp [-cfhrv][--help][--version][owned group] [file or directory ...] or chgrp [-cfhrv][--help] [--reference =][--version][file or directory ...]

Shell script statistic files carding and gain disk occupancy

1. Use shell script get_file_stat.sh statistics The number of directories in the bin directory executable file number, text file number #!/bin/bashCd/binDir= ' ls-l |grep "^d" | Wc-l 'Exefile= ' Find/bin-perm +111| Wc-l 'Txt_file= ' Find/bin-name "*

Shell in-process conversion

Decimal transfer to other system> Echo ' obase=16;4196939 ' |BC turn 16> Echo ' obase=2;4196939 ' |BC turn 2> Echo ' obase=8;4196939 ' |BC turn 8 Other decimal systems in turn> Echo $ ((16#122)) or echo $ (0x122) # ext. 16> Echo $ ((2#1010)) # turn

Shell Daily Combat Dos attack

Depending on the Web log or the number of network connections, monitoring when an IP concurrent connection number or a short time PV reached 100, that is, call the firewall command to seal off the corresponding IP, monitoring frequency every 3

Shell daily Practice-find intruders by monitoring users ' logins

#!/usr/bin/bash#用户检测入侵工具Authlog=/var/log/secureif [[-N $]];thenAuthlog=$1echo "Using Log File: $AUTHLOG"FiLog=/tmp/valid.$$.logGrep-v "Invalid" $AUTHLOG > $LOG #将系统中有效的用户users=$ (grep "Failed password" $LOG |awk ' {print $ (NF-5)} ' |sort|uniq) #

Child shell Test

Pstreeecho $$//Current process PIDEcho $PPID//Parent process IDSub-process test:New file:[Email protected]]~ # VI bashpid.sh#!/bin/bashEcho $BASHPID//测试[[email protected]]~ # echo $BASHPID //当前shell 6136 //结果[[email protected]]~ # bash

Linux exercises-shell Script programming basics (in construction)

1, write script/root/bin/systeminfo.sh, display the current host system information, including hostname, IPV4 address, operating system version, kernel version, CPU model, memory size, hard disk size2, scripting/root/bin/backup.sh, can be

Shell Script Basics----Variables

Definition of 1.1shell1. Stacking of Commands2. A file consisting of specific syntax and specific commandsExecute script commandbash test.sh 不需要添加执行权限,使用解释器直接解释sh tesh.sh./tesh.sh 相对路径,需要添加执行权限1.2shell Script Base---VariablesVariable: A

Test operation symbols in shell scripts and && | |

测试操作符 Common Test Operators English name Description -F file file files exist and are normal files True, that is, test expressions are set -d file Direct Ory

Service Management Scripts (SHELL)

devops-jenkins-master01]# Cat Console Script#! /usr/bin/bashCase $ inStartecho "Jenkins: Service started ...";Su-jenkins-c "/chj/app/chj-jenkins-master/bin/catalina.sh Start";; stop) echo "Jenkins: Service stopped ...";Su-jenkins-c

Shell BASIC Programming

Most basic: Remember the previous:#!/bin/bash, and the file suffix name is generally. shVI HelloWorld. SH #!/bin/bashecho"helloworld"Then remember to add permissions to the script, because the default is read and write permissions, default to all

Total Pages: 541 1 .... 394 395 396 397 398 .... 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.