Shell Test CommandThe test command in the shell is used to check if a condition is true, and it can be tested in three aspects of numeric, character, and file.
Numerical test
Parameters
Description
-eq
█ Start line The shell program must start with the following line (must be in the first line of the file)#!/bin/shThe symbol #! is used to tell the system that the parameter behind it is the program used to execute the file █ executable when editing
1. Date:show current date and time.2. Cal:calendar.3. df:to see the current amount of free space on your disk drives.4. Free:show The amount of the free memory (if using this command at Cygwin, CROCPS package should has been installed Fir ST).5.
Create 20 users with shell script, ask 20 users to specify the home directory as/share/home/, and give each user randomly assigned a password, and finally record these user information in the log![[email protected] sbin]# vim 2.sh mkdir -p
I. INTRODUCTIONHBase is a distributed, column-oriented, open-source database derived from a Google paper, BigTable: A distributed storage system of structured data. HBase is an open source implementation of Google BigTable, which leverages Hadoop
Restart the Tomcat shell script under the Linux system: tomcat_home=/opt/apache-tomcat-6.0 . 32 #找到tomcat进程的id并kill掉 ps -ef | grep Tomcat | awk { print $ "} | sed -e s/^/kill-9/g | sh - #删除日志文件, if you don't first delete it, you can leave
By using Word count to perform the process in Spark-shell, we want to see what Spark-shell did? The following script is in the Spark-shell, see Code Listing 1-1.Code Listing 1-1 Spark-shell
1234567891011
functionmain() { if$cygwin;
Eight, shell script sed&awk01.sed using the Flow editor-steam editor#ed/etc/passwd1,10p ... 1s/root/byf/p (replace root for BYF) #sed-E ' s/root/byf/g '/etc/passwd (function as above) just show the content change #sed-e ' s/root/byf/g '/etc/passwd >/
Commands common to the shell:1, and list with or list:1), and List (&&):Executes the next command when the previous command executes successfully.When there is an execution failure, reverse the "failure code" directly.Use:Statement 1 && Statement 2 &
In Linux systems, regular expressions (regularexpression) are powerful tools for finding, replacing, deleting, and so on for every Linux user, through the arrangement of special characters.In existing systems, regular expressions are also divided
Recently seen in the group sent a calculation, using the shell run without optimization, no algorithmTopic:A basket of eggs:A 1 to take, just to finish.2 2 and 1 left.3 3 Take it, just take it out.4 4 and 1 left.5 5 and 4 left.6 6 and 3 left.7 7
The shell's for loop format is as follows:For variable in listDo...DoneA list is a series of values that each value is separated by a space, once per loop, and the next value in the list is assigned to the variableThe in list is optional, if you do
Requirement Reason: Nginx does not have the log cutting function, the log volume is large, convenient analysis. Implementation purpose: Complete Nginx log cutting, and according to the time named Brief command:
Rookie learn shell script, hands practiced hand simple small experiment, use shell script to determine if Nginx is normal operation, if not run the Nginx service start up.First, based on process judgment1, get the nginx process to determine whether
A simple shell script
A simple shell script to writeSuppose I want to know how many people are currently logged on the system, and use the who command to tell you who is logged in to the system now:1.[[email protected] ~]$ who2.KANO
The most important system program that Linux systems provide to users is the shell command language interpreter. It is not part of the kernel, but is run as a user state outside the core.Its basic function is to interpret and execute various
PrincipleDivides the sorted array into sub-sequences (this depends on the originally set step value), then inserts the sequence directly between the individual sub-sequences, and then the increment (that is, the step value) and then inserts the sort,
Shell scripts are powerful and simple when working with text and managing the operating system.Combining shell scripts into your application is a great way to quickly implementThis article describes the use of Java code to invoke and execute 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