1. Date
Get time and date
Date = 'date + % Y-% m-% d-% H'
Echo $ {date}
2. cron
Add a Task Scheduler
# Vi/etc/crontab
Crontab task format
* *** User task
Minute hour, day, month, week, user task
Field
Description
Example about Linux Shell #! /Bin/bash echo "Hello world! " echo" Hello $ LOGNAME, it's nice talking to you " echo" U present working on a machine is 'uname-N' " echo" U Present working directory is $ (PWD) " echo" Bye for now $ LOGNAME. the time
1. String Truncation
(1) intercept the string before and after a specified character
[Root @ gd86 applications] # Var = Hello: zkl: zyh
[Root @ gd86 applications] # echo $ {var %: *} returns the first string from right to left.Hello: zkl[Root @
Regular Expression
$
Matches the end position of the input string. If the multiline attribute of the Regexp object is set, $ also matches '/N' or'/R '. To match the $ character, use/$.
()
Mark the start and end
Common grep command syntax 1. Double quotation marks and single quotation marksWhen you input a string parameter in the g r e p command, it is best to enclose it with double quotation marks. For example, "m y s t r I n g ". There are two reasons for
Anyone who knows makefile knows that makefile can call shell scripts. But in actual use, it is not that simple, and some ambiguity may make you crazy. If you don't believe it, let's take a look at several examples. Imagine what these examples will
Create an unzipped installation package in Shell
Principles
In Linux, you can use several basic commands to create a self-extracting program. The principle is: The Cat command can be used to connect two files (with> append can achieve the same
By using the startup script, you can make the custom environment ready for use once and for all.These scripts run when the shell is created.The startup scripts run vary depending on whether the shell is used to log on to the shell or not.We use "Su-"
Windows 98ShellLanguage
Yang shanhe
The Senior cfan from Dos crawlers knows that the batch processing language "batch" edits a batch processing file and can be executed in DOS immediately to complete tasks that do not require too much
"Hello World" shell scriptBased on the traditional program teaching example, we will introduce how to write shell script "Hello World.
--------------------------------------------------------------------------------
#! /Bin/sh# Filename: HelloEcho
Preface
Quick edit shell command line
The most common cause is that Nux beginners say that the most annoying thing is Linux/Unix command lines. If you are an impatient person, you can first try the comprehensive exercises at the end of the article
Instance
General programming steps
Now let's discuss the general steps for writing a script. Any excellent script should have help and input parameters. And write a pseudo script (framework. sh) that contains the framework structure required by
This article is Chapter 6 of "Learning the bash Shell" 3rd Edition, Command-Line Options and Typed varilables, but we will not limit it to this.
Previously, the variables we involved were basically strings and integers, for example, $ # Of the
This article is one of the seventh chapter Input/Output and Command-Line Processing of Learning the bash Shell 3rd Edition. We have learned the basic IO redirection operations of shell:>,
Cmd1|Cmd2: Pipe, SetCmd1Standard outputCmd2Standard
Use the dbms_pipe package and create a daemon running on the OS
I think this method is complicated. I still need to use Pro * C. I didn't try it. Here is an example.
Use Java's getruntime(cmd.exe C
Java uses a lot of such advantages.
1) write a
Simple shell script encapsulation for wget
Article: http://blog.csdn.net/5iasp/article/details/8862303
Author: javaboy2012Email: yanek@163.comQq: 1046011462
Purpose: capture a url and save it to a specified file in the specified directory.
From: http://blog.sina.com.cn/s/blog_7556be720100ryp2.html
CTRL + P repeat the previous command
CTRL + a jump to the first characterCTRL + x same as above, but once again, it will return to the original locationCTRL + B move one character forward
In Linux, It is very troublesome to use ruijie. After installing myxrgsu, you must enter your account and password every time you use it. This process is too cumbersome. So I want to find a way to automatically enter the password and other
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