Unix/linux System Management Technical Manual study notes--shell

Date Created: 2016/02/29Update on: 2016/02/29 Shell variables cannot be left blank on both sides of the equals sign, otherwise the shell will mistake the variable name for the command name Variables enclosed in double quotes can be replaced

CENTOS 6.6 init Shell script

This script is what you might need to do after you've just installed CENTOS6.6. When learning CentOS, you can run this script to do some configuration to help you not be bothered by these firewall yum SELinux IP.#!/bin/bash  #判断是不是root用户if  [[  "$

Shell Scripting Exercises

1. List the directory under the current directory (only one level is required)1 #!/bin/bash 2 for f in ' LS ' 3 do 4 if [-D $f] 5 then 6 echo $f 7 fi 8 done2, the current directory of files (only need a level) listed1 #!/bin/bash 2 for f in ' LS ' 3

Shell upgrade complete record

[email protected] bash-4.3.30]# cat Makefile |grep Prefixprefix =/usr/localExec_prefix = ${prefix}Datarootdir = ${prefix}/shareBindir = ${exec_prefix}/binLibdir = ${exec_prefix}/libIncludedir = ${prefix}/includePrefix=${prefix}

Shell implementation of a simple calculator function small script

Nonsense not much to say, directly on the code, the basic implementation of subtraction functions:#!/bin/bash# author by alsww# date : 2016.02.03# mail : [email  protected]# blog : alsww.blog.51cto.comprint_info () {    printf  " Please enter the

Shell's Features

Shell's Features~/.bash_history command history to store files, log out after saving.$HISTSIZE the number of command history bars, which allows the ~/.bash_history file to store the number of command bars, by default.!! : Previous command!$: Last

Shell (1)

Bash variable Category: Local variable: Also called local variable, valid only for the current shell process Environment variables: current shell and its child shell, child shell .... Special variables: $? The status of the last

Shell Special variable collation of "Linux"

Catalogue 1. List of special variables 2. Special Instructions In the shell, variable names can only contain numbers, letters, and underscores, because some variables that contain other characters have special meanings, and such

Commonly used action statements in shell script files

1. Clear the contents of the fileCat/dev/null >>/var/log/messages2. The script to determine whether the user is the root userRoot_uid = 0 # $UID is 0 o'clock, the user has root user rightsIf ["$UID"-ne "$ROOT _uid"]Thenecho "This user isn't

Shell programming-instance output system Information

Output System Information#!/bin/bashif [$#-eq 0];then echo "---------------------------------------------------------------------------" # OS type echo "OS Type: $ (uname-o)" # OS Release Version and Name echo " OS Release Version and Name: $

Several small topics of shell variables

1. Describe the results of the following commandsMore/etc/shellsDisplays all the contents of the shells text.Echo $SHELLView the shell program used by the current user.History-cClear historical and practical commands.Echo $HISTIZERecord the history

Shell script output diamond and equilateral triangle

ObjectivePractice the shell to improve your logical abilities.ScriptTriangles and diamonds are implemented through several for loops, but can also be used while.Here is the script content:Triangle#!/bin/bashread -p  "Please input the longs:"

The use of SEQ in the shell

The use of SEQ in the shellExample:/bugzilla/group.00....group.99 more than 3 years of data mv to/history/bugzilla/group.00...group.99Seq-w (-w = 0 in front to make the same width)#!/bin/bashFor Inum in ' seq-w 00 99 'DoSsdir=/bugzilla/group.

Birthday, also want to learn ha, this time is the shell of getopts

Today is WebSocket,Complete the getops of a shell first, Monday will be useful.#!/bin/BashEcho "usage:./$0-T (prism|opscripts)"functionscp_prism () {Echo "scp_prism ()"}functionscp_opscripts () {Echo "scp_opscripts ()"} whilegetopts t:h OPT Do

1.2 Shell variables

#系统变量Env View System Variablesecho $HOSTNAME View variable contentsSet view system environment variables, also display user-defined variables, compare all#用户自定义变量a=1;b=2 Defining variablesecho $a $b output variable value#引用变量执行结果Myvim= ' which vim '#

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

Shell Exercise 1

Write a script: The requirements are as follows:1: Say hello to each user in the/etc/passwd directory, and indicate its UID number! (Eg:hello Root,your uid is 0)2: How many accounts does this script share?#!/bin/bashName= ' cat/etc/passwd |awk-f: ' {

JAVA commonscollections WebLogic Write shell of the deserialization vulnerability

Refer to the content of many posts in the cloud Zone, organized the nextWeblogic1. Write the shell to the console images directory and write

Linux shell array creation and usage tips

The Linux shell is much more powerful in programming than Windows batch processing, both in loops and operations. Data types are not comparable. Here's a summary of some of the things that an individual does when it comes to working with arrays.1.

Shell and WMI get Windows performance

Linux Machine First installs wmi-1.3.14.tar.bz2TAR-JXVF wmi-1.3.14.tar.bz2CD wmi-1.3.14MakeCP samba/source/bin/wmic/usr/local/bin/Pass parameter information through the file into the script and get the outputWmi.sh ————————————————————#cat/mess/host|

Total Pages: 541 1 .... 373 374 375 376 377 .... 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.