Interactive commands: Variable content is determined by the userRead [-PT] Variable-P: Can be followed by a prompt-T: The number of seconds to wait afterecho [-ne] Stringecho [--help] [--version]-N: Do not wrap in the last line-E: If the following
1. Monitoring commands (run once every 2 seconds)watch "ls -larth"2. Kill the program with one portsudo fuser -k 8000/tcp3. Limit the memory usage of the following commandsulimit -Sv 1000 # 1000 KBs = 1 MBulimit -Sv unlimited # Remove limit4.
WedgeRecently like the script so learn a little bit and solidify yourself.Simple Log emptying note! This is a test environment that can be emptied freely.Cd/var/logCat/dev/null>messagesecho "Logs cleaned up."One, can vim a file name example
(1) The shell prints the pattern as shown.650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M01/07/9D/wKiom1nMh-ygSI1MAAAj5j4UcHs376.png-wh_500x0-wm_ 3-wmp_4-s_3715701053.png "title=" capture. PNG "alt=" Wkiom1nmh-ygsi1maaaj5j4uchs376.png-wh_50
by Francis_hao Sep 30,2017Photo from reference "1"This article was authored by Liu Yinghao and licensed under the Creative Commons Attribution-NonCommercial use-Share 3.0 Chinese mainland license agreement in the same way. Welcome reprint, please
The shell function is similar to a shell script, which holds a series of instructions, but the Shell function is in memory, not the hard disk file, so it is fast, and the shell can preprocess the function, so the function starts faster than the
The Shell's own abilities.Writing scripts is OK, at least now I'm running a script on the InternetProgram-Log scheduled backup and delete, NFS Shanghai volume file Delete and send mail."Data"Export
Logical symbols1. about the file and directory of the detection of Logical volume label!- F Common! Detect if "Archive" exists eg:if [-f filename]- D common! Detects if the directory exists- B detection is a "block file"- C detection is a
Problem situation:1. Hive Shell Chinese garbled 2.Hbase Shell Chinese garbled Solutions 1At the command line, enterExport lang= "en_US. UTF-8 "then enterTemporarily change system encodingThis method is only temporary.Workaround 2sudo
Need to read a text, the second text each line contains an IP in the while loop using SSH, but after the first line of SSH exited, how to avoid automatically reading a line out of the while loop, this article will explain its reasons in
This blog is referenced from:Http://www.cnblogs.com/waitig/p/5523409.html"Shell from Beginner to mastery" Zhang ChunxiaoShell IntroductionThe shell itself is a program written in C, a user to use UNIX or Linux bridge, most of the user's work needs
File system1. File system partition structure is divided into Inode group and data domainThe 2.linux file is divided into directories and binary files3. Catalog items are stored in the directory, and the directory entry records the file name and
shell programming often encounters strings, file content-case conversions, and choosing the right commands in different scenarios can improve programming efficiency. Applicable Scenariosfile contents or strings that need to be converted to uppercase
File comparison Operators-e filename true if filename exists [-e/var/log/syslog]-D filename True if filename is a directory [-d/tmp/mydir]-F filename True if filename is a regular file [-f/usr/bin/grep]-L filename True if filename is a symbolic link
Environment variables in Linux include system-level and user-level, system-level environment variables are system variables to be read by every user logged into the system, and user-level environment variables are the environment variables that are
The idea is to learn the code creation is their own very like the first few lines of logic rigorous#!/bin/bash#判断两个整数的大小Read-p "Please enter two integers a B:" A B#或者使用a =$1[-Z "$a"]| | [-Z "$b"]&&{echo "The number you entered is zero"Exit
For syntax formatfor Var in list;doCommandsDoneWhere list can contain:1) write directlyFor Alpha in a B C d;do echo $alphadone2) variablesList= "A b c D" for Alpha in $list;d o echo $alphadoneThe variable is replaced when the shell executes,
Because the shell appears to be a common feature between UNIX systems and is standardized by POSIX.As a result, shell scripts can be applied to many systems once they are "written attentively".Therefore, the shell script is used because of the
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