Basic operation of the service/etc/init.d/sendmail Start # Launch service/etc/init.d/sendmail Stop # Close Service/etc/init.d/sendmail Status # View the current status of the service/date/mysql/bin/mysqld_safe--user=mysql # start MySQL background
This afternoon wrote a simple one-click Automatic Virtual Host shell script, the script to implement automatic configuration Nginx virtual host, automatically create FTP account, automatically create a database, users, and automatically achieve
Introduction to Linux file commands:
This command is used to identify file types and to identify the encoding format of some files. It gets the file type by looking at the header information of the file, not as if Windows determines the file type
1. Character truncation:If the character truncation is a generic path, you can use both the basename and dirname tools:BaseName can truncate a filename from a file path
For example:
Copy Code code as follows:
$
A name to know what PcAnyWhere mean, PcAnyWhere is a set of established remote control software, can run under windows95/98/nt/2000/me. Users can remotely manage computers connected to the Internet or the intranet through a master or a controlled
Demo Effect:
1, the first level menu
2, Level two menu
3. Perform operation
Script reference:
Copy Code code as follows:
#!/bin/bash
#author Lic (Oldboy Linux student)
#date 1304
disk_no= "/DEV/SDA1"
Nginx_dir= "/usr/local/
1. Define functions within the shell file and refer to:
Copy Code code as follows:
[~/shell/function]# Cat factorial.sh
#!/bin/bash
function factorial
{
Factorial=1
For ((I=1;i Todo
factorial=$[$factorial * $i]
Done
Write a shell script under Windows, upload to Linux run the Times wrong:
Copy Code code as follows:
[Root@localhost test]#./test.sh
-bash:./test.sh:/bin/sh^m:bad interpreter:no such file or directory
Test.sh Source:
Copy
First, define the shell function (define functions)
Grammar:
[Function] funname [()]{Action[Return int;]}
Description
1, can be defined with function fun () or directly fun (), without any parameters.2, the parameter returns, may display adds:
The shell monitors the site for unusual script, such as an abnormal automatic email notification to the administrator.
Process:
1. Check that the Http_code returned by the Web site is equal to 200, if not 200 as an exception.
2. Check Web site
Scripting programming languages and compiled languages:
Scripting programming Language: (Bash)
The scripting language is usually interpreted (interpreted), which is read into the program code primarily by the interpreter (interpreter) and is
#!/bin/bash#author:yanconggod#date:2017-01-19#version:1.0# using uptime command to monitor system load postfix_path= "/usr /sbin/postfix "mailx_path="/usr/bin/mailx "email=" [email protected] "# get native IP address ip= ' IFCONFIGENP2S0 |grep '
Use shell scripts to implement a one-click installation of the LANMP system. The operating system used is CentOS 6, which does not differentiate between 32-bit and 64-bit, requiring the machine to connect to the Internet. Supports both LAMP and LNMP,
This error occurs because some Linux systems use Ash to compile shell scripts by default, as is my machine, but the scripts I write should be executed with bash. Although I noted in the beginning #!/bin/bash, as if it is still the default to find
Create a shell scriptWhen you create a shell script file, you must specify the shell to use in the first line of the file, in the format:#!/bin/bashCreate and execute SH scriptCode 1-1[Email protected]:/data# cat demo1 #/bin/bashdatewho[email
In the previous blog post, we have learned how to coordinate how each level in the whole system works, and the command issued by the application layer reaches the drive layer under the kernel, thus achieving the purpose of operating the hardware
Description: +n is greater than N,-n is less than n, n is equal to N.Find/-amin-30-ls # finds files accessed in the last 30 minutes of the systemFind/-atime-2-ls # finds files accessed in the last 48 hours of the systemFind/-mmin-10-ls # finds files
Guide
When you're going to really manipulate your Linux system, there's nothing like a command-line interface that lets you do that. To be a Linux master, you must be able to understand the different types of shell commands and use them
#! /bin/bash# transferring code and scripts to the Worker node # change the current working directory CD ${Amazoncrawler_home}#读取worker节点ip列表i=0 whileRead Line1 Do#去除空格 line1= ' echo $line 1 | Sed s/[[:space:]]//g ' #若为空则忽略本行if["$line 1" x = x];
Until cycleThe environment used to perform loops when a proposition is falseWhen a proposition is false, it enters the loop; exit the loop when the proposition is trueOr if the condition is not satisfied, enter the cycle of the sceneIn logical
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.