The original article was written at 18:29:20,. NetEase blog has been deleted.To generate a random number in shell, you can call $ random in Bash to reference an introduction to random.Each time this is referenced, a random integer between 0 and 32767
-B. returns true if the file exists and is a block file.-C: returns true if the file exists and is a character file.-D. If pathname exists and is a directory, true is returned.-E: returns true if the file or directory specified by pathname exists.-F
Document directory
Function Definition
Return Value
To put it simply, the popen () functionFunction Definition
#include FILE * popen(const char *command , const char *type );int pclose(FILE *stream);Function Description
The popen () function
During the bug quality analysis, the word segmentation should be sorted and de-duplicated, so we thought of sort and uniq.
It is very convenient to call shell through python.
#-*-Coding: UTF-8 -*-Import OSImport sysDef cws_statistics (flag, afile,
In the bash shell series, when talking about variables, we first talk about the functions and modifications of environment variables, and then continue to talk about the use of historical commands. Next, let's talk about the important concept of
This is my usual work desktop. Or this is the Emacs I usually work on.
To see the big picture, click here
The above figure shows a 4-window working mode that many people like very much. This mode is widely used by shell users. I once liked this
Bash brings command line editing, and countless people are blessed.
Yes. This is the case. The command line editing is really a good friend in our daily work. Can you still imagine how it feels to work in an ancient Bourne shell without command line
If you have a small requirement at work, you need to rename a series of files.
The original format is string_1.obj. Now you want to change the number in the file name to a fixed length. If the number is less than the number of digits, it is changed
Author: gnuhpcSource: http://www.cnblogs.com/gnuhpc/
I. "'$ var '"In this way, you do not need to change the habit of using the awk program. It is a common method used by foreigners. For example:Var = "test" awk 'in in {print "'$ var '"}'In this
According to the shell programming of laruence's private dish, there is an inexplicable problem.For example:
# Test if else
Read-P "input y/n? : "YN
If [$ YN = "Y"]; then
Echo "continue ;"Elif [$ YN = "N"]; thenEcho "break ;"ElseEcho "PLS
Http://blog.chinaunix.net/u/29289/showart_407859.html
A read operation can assign values to multiple variables at a time, but only one row can be read at a time. For example:
#! /Bin/bash ifs =: Read aa bb cc
In this article, through the summary of variable declaration, loop statements, condition judgment, and data superposition in shell scripts, most scripts of Linux daily management can be solved.
1. Variable declaration:
Is a weak language, with name =
Location parameters can be used
shiftCommand left shift. For example
shift 3Indicates the original
$4Change
$1, The original
$5Change
$2And so on.
$1,
$2,
$3Discard,
$0Do not move. Without Parameters
shiftThe command is equivalent
shift 1. Very
Document directory
Use the top script to retrieve the CPU of a process:
Add User:
IP address access statistics:
Calculate the sum of 2 numbers
Text Analysis
File Sorting
Print the swap partition size of the Local Machine
Output the time
1. Create and run Shell programs
What is a shell program? Simply put, a shell program is a file containing several lines of shell or Linux commands.
Like programming in advanced languages, writing a shell program requires a text editor, such as VI.
The issue is that in w2k3 Telnet Server(Tlntsvr.exe) no longer runs as LocalSystem and needs to run the CMD Process(Cmd.exe) usingCredentials of the logged in user. If Secondary Logon Service is notStarted, TelnetServer process cannot start the CMD
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