Workaround:
1. Use split command to cut large files, save 1 million lines per small file
Split parameter:
-B: The following can be divided into the file size, can add units, such as B, K, m, etc.;-L: Split by number of rows;
#按每个文件1000行来分割除
Previously only heard DreamHost support shell, but not specifically used, mainly in the past is not very need, has not uploaded too many things.
Recently because to upload a large number of files, suffering from the speed of optical cable can not
Description
Cut press the column to split the file and you can specify the delimiters for each column. In cut terms, each column is a field, sometimes the first column, which may be described as the first field.
Actual combat:
Suppose there is a
Quote: I have never written a shell script before, perhaps because of laziness, perhaps not being forced to write a shell. However, some time ago, the job requirement required a rerun of the script for a few months, which ran regularly every day,
#查找当前目录中是否存在指定目录, if it does not exist, it is created
Copy Code code as follows:
function mkdir_1
{
if test! -D $
Then
mkdir $
Fi
}
#指定文件中的 "prefix =. *" string replaced with "prefix=/home/gnome-unicore-install2/usr/
Install rsync in Redhat
1, first on the server and the client are installed rsync, my RHEL5 by default has been installed. When installing REDHAT5, you can see it in the "basic system" in software Customization-"basic" optional packages: rsync-2.6.8
I said, the shell is my conventional weapons, although not yet proficient, but I love the shell of the language, under Linux mixed, always write a script. Programmers have genes, there is a preference for programming languages, you let me write C
The awk function split (S,A,SEP) splits a string s into a awk array a using the delimiter Sep.
Set time = 12:34:56Set hr = ' echo $time | awk ' {split ($0,a, ":"); Print a[1]} ' # = 12Set sec = ' echo $time | awk ' {split ($0,a, ":"); Print A[3]} '
A few examples of shell scripts, it feels good.
"Example: 001" to judge the input as a number, character or other
Copy Code code as follows:
#!/bin/bash
Read-p "Enter a number or string here:" Input
Case $input in
[0-9])
Today to optimize the company's new deployment servers, found that the TTY terminal has 6, in order to save a bit of memory, decided to leave only a TTY terminal, the others are off, but CENTOS6 and centos5 terminal closure method completely changed,
Customer requirements, do not want to allow foreign IP to access the server, would have to let the computer room in the upper route to solve, but those people do not bird you!!! ~~~~In this case, you can only use iptables to solve the ~~~~~~~~~About
A simple shell script to find out if a critical service is running and is suitable for Linux or UNIX operating systems.The script can also send notifications using e-mail.
Code:
Copy Code code as follows:
#!/bin/bash
#
1, look at the machine installed which shell?
There are two ways to view it.
First type:
[Rocrocket@wupengchong ~]$ Chsh-l/bin/sh/bin/bash/sbin/nologin/bin/zsh
The second type:
[Rocrocket@wupengchong ~]$
Learn to use shell analysis log only one morning!!!
Many places to share the log analysis of the shell script, but basically did not say the specific meaning of each command, learning cost is very high, summed up here, to facilitate the quick start.
It is not a programmer's job to tailor an icon of every size needed to the shelves one at a time before the app is put on the shelves, and using the SIPs tool from the MAC can solve this requirement.With respect to SIPs, the following information
Array as a data structure, in some high-level languages are directly provided and implemented, of course, my shell is also some ha.
PS: This article is written because brother B in the group sent a screenshot:
My big B elder brother is still
New ordinary users in Linux are generally not assigned to root permissions, and each time su root is too cumbersome, you can add the current user in the/etc/sudoers file, the current user to give the use of the sudo command.# Switch to root user
Examples of find common usages in LinuxFind Path-option [-print] [-exec-ok command] {} \;The parameters of the Find command;The directory path that the Path:find command looks for. For example, use. To represent the current directory, and/to
the function of the echo command is to display a piece of text on the display, which generally acts as a hint. the general format of the command is: Echo [-n] string where option n means that the output text is not wrapped, the string can be quoted,
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