Linux must use the Linux shell command . Nonsense! You don't know any Linux commands , such as Ps,grep,ls, but you can still use a lot of modern Linux desktop distributions.
Linux system administrators are not like desktop users, they don't
This section describes several shell scripts that can be used to extract I/O information from the disk, system load load information, and so on
1, extract the system load information
Copy Code code as follows:
#!/bin/sh
host=$ (hostname)
This article mainly introduced the Linux Shell script view numa information, this article directly gives the script implementation code, needs the friend may refer to under
Nova provides NUMA-related advanced features in the NFV scenario, which
Process state variables
1, $$ get the current shell process number (PID)2, $! executes the PID of the previous instruction3, $? Gets the return value that executes the previous command (0 is a success, Non-zero is a failure, this is very common)4. $
How to identify the number of physical CPUs, a few cores, is hyper-threading or multi-core
Judge the basis:
1. CPUs with the same core ID are the same core hyper-threading.2. CPUs with the same physical ID are the same CPU-encapsulated threads
When writing programs, we often use timers. First look at the Select function prototype as follows:
Copy Code code as follows:
int select (int Nfds, fd_set *readfds, Fd_set *writefds,
Fd_set *exceptfds, struct timeval *timeout);
Create child process, parent process exitsThis is the first step in the process of writing a daemon. Since the daemon is detached from the control terminal, the first step is to create the illusion that a program has been completed in the shell
Today colleagues idle, asked me to help in the Linux login page to add something he thinks is very unique, look at his hair, said to him is very silent, below to see.
Script 1:
Cat clcal.sh
#!/bin/bash # show Chinese lunisolar calender. # 2011
Iterating and traversing the lines, words, and characters in a file is a very common operation when you are working on a text file. Using a simple loop for iterations, plus a redirection from stdin or files, is the basic way to iterate through the
The string interception of Linux is useful. There are eight different ways.
Suppose there are variable var=http://www.aaa.com/123.htm.
1. # Intercept, delete left character, keep right character.
Copy Code code as follows:
Echo
I remember last year when I was looking for a job interview, I heard a classmate say that he likes Linux very much, I believe what he said is true, I think the people who like Linux are very happy from the shell script, because it can integrate the
1. #annotation function, #! ExceptIn addition, in the parameter replacement echo ${path#*:} here does not represent a comment, a numbering conversion, does not represent a comment echo $ ((2#101011))
2.;
Command line separator, you can write
One line can be done, output 32 or 64.You can use "getconf word_bit" and "getconf long_bit" to get the number of digits for WORD and LONG, and 32 and 64 for 64-bit systems respectively.The reference code is as follows:
Copy Code code as
This example describes the Java method for invoking shell commands. Share to everyone for your reference. Specifically as follows:
Recently, the project has such a demand: the system of foreign currency funds after the completion of the dispatch of
Script 1: Write a login welcome script for root users:
1, with vi command in the/root directory is a new script file welcome.sh, the contents are as follows:
2, using the chmod command to welcome.sh file to increase the execution (x) permissions
0. Initializing the Environment and OLE objects
#include #include // 初始化COM环境CoInitialize(NULL);// 创建Shell对象Variant vShellOLE = Variant::CreateObject("Shell.Application");
1. Cascade windows
Environment:
SSH server:192.168.100.29 server.example.com
SSH client:192.168.100.30 client.example.com
Create secret key authentication through root user to implement Shell script management, distribution, deployment
First, the client side
Tag: Indicates the return value of the CTR online packet host Images network SRCDetermine which hosts are online in the current network (the ping return value is true, indicating that the host is online)The trap instruction is used to perform 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