Method One:Modify the/etc/sysconfig/i18n fileChange the lang= "en_US" inside to GB2312.To restart the machine.Without restarting the method, directly# lang= "GB2312"And then we can.Modify i18n just to restart the activeMethod Two:#vi
Type of Shell:1. Log-in ShellLog in normally via a terminalSu-Su-l2. Non-login shellSuCommand window open under graphical terminalShell scripts that are executed automaticallyBash's configuration file1. Global
1. Use grep (the result is enclosed in parentheses. I wonder if I can match the content in the brackets only)
$ A = 'abc [EDG] adfirpqu '$ echo $ A | grep-O '\[. * \] '# escape [EDG] $ B = 'abc (EDG) adfirpqu' $ echo $ B | grep-O '(. *) '(EDG)
2.
Recently, I sent a peid shell check tool to everyone. Maybe the newbie doesn't know what this is.Let's take a look at its usage.Peid is now the most popular shell check tool. The so-called "shell" is to put a "shield" on the program, which can be
Tag: String null
Integer comparison:
-EQ equals to, for example, if ["$ A"-EQ "$ B"]
-Ne is not equal to, for example, if ["$ A"-ne "$ B"]
-GT is greater than, for example, if ["$ A"-GT "$ B"]
-Ge is greater than or equal to, for example, if ["$
While do done, until do done (indefinite loop)
While [condition]
Until [condition] Do program section done
[[email protected] scripts]# vi sh13.sh#!/bin/bash# Program:#Repeat question until user input
For Loop
1.
List for Loop
For variable in {list} # For each in C ++/CLR
Do
...
Done
For example:
1.
[[Email protected] TMP] # Cat B. Sh
#! /Bin/bash
For I in 1 2 3 4 5 #1 2 3 4 5 is equivalent to {1 .. 5}
Do
Echo $ I
Done
[[Email protected] TMP]
Introduction:In the previous article, the incremental data in Oracle10g is imported into hive0.13.1, and the master table in hive is updated. http://blog.csdn.net/u010967382/article/details/38735381 describes the principle of incremental update hive
[Copyright statement: reprinted. Please retain the Source: blog.csdn.net/gentleliu. Mail: shallnew at 163 dot com]
In most cases, the print statement of the awk can complete the task, but sometimes we need more. In those cases, awk provides two well-
The script is as follows:
#! /Bin/sh # Name of the process to be checked progress_name = "heihu_server" # ------------------------------- # function: checkprogress # function: Check whether a process exists # parameter: $1 --- Name of the process to
The raw data is in the final baiang.txt file.
Shell command:
Cat ‑qiang.txt | grep-P "^ country | ^ ☆" | awk-F" "'{print substr ($2, 1, 2 );} '| sort | uniq-c | sort-NR
The result is as follows:
27 Jiangsu22. Shandong Province18 Zhejiang10 Liaoning7
Labels: Bash internal and external commands
What is an internal command? What is an external command?Internal commands: commands provided by the shell programExternal command: executable program in a path inside the system.
The search for
1. clearnginxlog. Sh
#! /Bin/bash
# Run at 2: 00 am every
Nginx_pid = "/run/nginx. PID"
Logs_path = "/opt/log/nginx"
Logs_date = "$ (date-d" yesterday "+" % Y % m % d ") _ 'date + % Y % m % d % H % m % S '"
MV $ {logs_path}/access. Log $
Option name
Format
Description
-Ls
-Ls
View the current directory structure of the specified path
-LSR
-LSR
Recursively view the directory structure of a specified path
-Du
-Du
Measure the file
--- Content from http://www.jb51.net/article/31232.htm
By default, values assignment and operations in shell are processed by strings,1. Example of an error methodA)Var = 1 + 1Echo $ VaRThe output result is 1 + 1. Tragedy.B)Var = 1Var = $ var +
What is the difference between $ @ and $ * in shell learning?
Before talking about $ @ and $ *, you must start with the positional parameter of shell script...We all know how variables are defined and replaced.However, we also need to know that
What is the difference between shell Learning (and?Strictly speaking,
Because 0 is the default value of
> This method is used to export data to a file. If the file does not exist, the file is created. If the file exists, the file is cleared.
[Shell] input parameters
Obtain the input parameters of the shell script and the obtained parameters.
#! /Bin/bash # title: testPT. sh # atuhor: orangleliu # date: 2014-08-08 # desc: enter two parameters and the second digit. Print them if they are
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