Linux shell script output with color textThe color of the text terminal can be generated by using the ANSI unconventional character sequence.Example: "Echo-e \033[44;37;5m BLUE \033[0m""Echo-e \033[44;37;5m BLUE \033[0m BLACK"The area that needs to
12. Sort commands for Rowssort:1. Sort command-line options:
Options
Describe
-T
Separators between fields
-F
Ignore case when sorting based on character
-K
Define
Description:
Although the problem is not big, it is really disgusting. My goal is to process access logs.
Logs are separated by \ t for easy processing. data needs to be filtered and processed.
I don't want to filter it into a temporary file and
1. for arithmetic operations. There are several assignment methods:
Let a = 1 + 2Echo $
A = $(3 + 3 ))Echo $
A = $ [4*4]Echo "$"
Set $ [A = 5*5]Echo "$"
2. Determine whether a directory exists:If [-d "$ (PWD)/.../candpointer"]; thenEcho "
Here we recommend a few Linux books and good tutorials to help learners avoid detours. It can make boring things fun. Isn't it?
First recommended entry-level books:
Laruence's Linux basic learning for Private food (3rd)
It explains Linux in a
Requirement: create 10 SYSTEM account oldboy01-oldboy10 in batches and set to generate password (different password ).
Implementation script:
#!/bin/bash#Question3for i in $(seq -w 10)do useradd -s /bin/bash oldboy$i echo "password$i"
Background:Access to Site Resources outside China is sometimes very slow. an occasional download is certainly tolerable. It is a wise decision to build an image site for multiple use or internal use by a small team.This section uses the yum source
========================================================== ==========
This article is the original khler, and the original author information and the original link of this article must be kept completely and completely reprinted.
Author: HeYuanHui
E-
After the CLR in-process side-by-side feature is introduced in. NET 4, we can use C # To compile Windows Shell. We can find related examples In Microsoft's All-In-One Code Framework. There are also several articles about it In the yard:
Windows
1. Introduction to file typesLinux mainly includes the following seven file types: d directory-common file l symbol link s socket file B device file c character device file p name pipe File
2. Regular ExpressionRegular Expressions are very important
Access Parameters
You can use process. argv to access the command line parameters. It is an array containing the following content:
[NodeBinary, script, arg0, arg1,...]
That is to say, the first parameter starts from process. argv [2]. You can
Day 3: Select Conditions
Outline
Application Instance Analysis
Conditional Test
If... Else... Fi
Case... In... Esac
Implementation menu:
After the script is executed
Press 1 to display the current time
Press 2 to display the CPU load
Press 3 to
#! /Bin/bash# Name: remove_one.sh# Purpose: Find and delete duplicate files. Only one sample is retained for each file.# Sort and output files by sizeLs-lS | awk 'in in {# Obtain the total number of the first row and discard it. Read the next
Background any program running will inevitably generate a lot of logs, of which error logs need to be the most concerned. In some cases, the error log and the normal log are separated, but our system does not. What's more troublesome is that one log
Write SHELL scripts to monitor hosts
1. Run the vi command to create a script file sysmon. sh in the/root directory:
The content is as follows:
#! /Bin/bash
Dug = $ (df-h | grep "/$" | awk '{print $4}' | awk-F % '{print $1 }')
Cug = $ (expr 100-$
Because the application of shell is not too long and has never touched on arrays in actual projects, we need to convert something like a = 1, 2, 4, and so on today. We used awk to retrieve them separately. So today I want to see if there is a better
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