Output redirectionThe syntax for command output redirection is:Command > file or command >> fileIn this way, the contents of the output to the display can be redirected to the file. If you don't want the file content to be overwritten, you can use >>
Bash supports a number of operators, including arithmetic operators , relational operators , Boolean operators , string Operators , and file test operators .Native bash does not support simple math operations, which are string operations by default,
Shell-related usageIf usage-Q does not output results, only make judgments[Email protected] tmp]# if Grep-q ' ^daixuan: '/etc/passwd; Then echo "Daixuan text"; fi, when/ETCPASSWD contains Daixuan, the output Daixuan testCase usage[Email protected]
Requirements:1. Display the current system date and time, and then create the directory/tmp/lstest2. Switch working directory to/tmp/lstest3. Create a directory A1d,b56e,6test4. Create an empty file xy,x2y,7325. list files or directories in the
The function is actually to give a code a name, each time you use this code can directly use the function name to invoke it.First, create a functionThere are two kinds of formats for creating functions:Format 1:function function name {function
Java suspended animation, but the process is still in, you can determine whether the log file changes over time to determine whether Java suspended animationThe shell script is as follows:#!/bin/bash# #通过比较五分钟前后, log file MD5 value is the same, to
The type of shell that stands on the user's point of view:Log-in Shell:Log in normally via a terminalSu-usernameSu-l usernameNon-landing shell:SU usernameOpen Command Window under graphics terminalShell scripts that are executed automaticallyBash
In the process of learning Linux, have encountered some small problems, although may be insignificant, but in the pursuit of details often will be more tangled (obsessive-compulsive disorder), empty a blog post space, record some details on the
Freshman semester to learn the basic operation of Linux, has not been used for a long time, the virtual machine has not opened nearly half a year (as a computer professional juvenile really should not). To replenish this knowledge and lay the
Cat /etc/passwd All system user accounts list and basic information for each user cat/etc/meminfo the current state of the virtual memory ipcs-m View the Shared memory page on the current system [[email protected]~] #当前shell的用户名, current
Modify the Tomcat Server.xml to unpackwars= "false", and then Maven generates a. War with two functions:1 No manual decompression required. War (Tomcat is not automatically decompressed if there is a folder with the same name and a war with the same
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
First, write shell scripts to add users in bulkImplementation method: To determine whether the user exists, there is a return error prompt, while determining whether the user file exists, does not exist then exit1. Create Add User Script[Email
#shell特性| Pipeline> Redirection>> Chasing heavier orientation2> Error Redirection2>> Append Error redirection#作业控制CTRL + Z to temporarily stop the jobJobs View JobFG recalled to front desk+ Higher PriorityFG 2 designated number recallBG tuned to
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: ' {
The shell is born in Unix and is a tool for unix/linux interaction, and it doesn't make sense to learn the shell alone.The shell needs to rely on other programs to do most of the work, which may be his flaw, but its undoubted strength is that the
Requirements:
This directory is currently created if the result directory does not exist.
If Socwatchoutput.csv is present, move it to the result directory
Then, pass the parameter kpi_name,
#!/bin/sh#Used to save CSV file#write it by
In shell programming, "EOF" is usually used in conjunction with "Return to the keynote shell again, which can be interpreted as a delimiter (delimiter). Since it is a delimiter, the form is naturally not fixed, where "EOF" can beCustom, but the
# make direcory for backset file and scripts file,in my Case/backup/db_bakCd/backup/db_bakmkdir Scripts Logs Rman# The following is contents of Rman_backup_shVi/backup/db_bak/scripts/rman_backup_sh#!/bin/bash# author:anbob.com# Desc:rman Backup
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