Check whether duplicate rows exist in the second column of the file, and extract the second column of duplicate rows.In actual work, there are millions of rows and more columns. Here we only list a small part, as shown below: cnyunwei. log09207626130
Shell script application and loop statements
1. bash wildcard:
1 .? // Any single character
2. * // 0 or multiple characters
3. [] // any character in the interval
4.; // split the command, ignore the execution result of the previous command, and
Linux shell has a set of its own process control statements, including conditional statements (if), cyclic statements (for, while), and select statements (case ). The following example describes how to use each statement.
I. shell Condition
Scheduled tasks in Linux automatically delete old files n days agoLinux is a system that automatically generates files, such as logs, emails, and backups. Although hard disks are cheap now, we can have a lot of hard disk space to waste these files,
Checks system hardware information of online servers, including IP addresses (intranet, all), IP addresses of remote control cards, cpu information (cores), memory, hard disks, machine codes, manufacturers, and product names.#! /Bin/sh# Checking
Data backup is required for any online e-commerce site. Regardless of version updates or server migration, the importance of backup data is self-evident. Manual data backup not only consumes a lot of time and effort, but is not very professional. As
I. Special files:/dev/null and/dev/ttyLinux provides two special files that are very useful for Shell programming:/dev/null and/dev/tty. /Dev/null will discard all data written into it. In other words, when the program writes data to this file, it
1. display the 10 processes that consume the most memory/CPUPs aux | sort-nk + 4 | tailPs aux | sort-nk + 3 | tail------------------------------------------2. view the number of concurrent Apache requests and their TCP connection statusNetstat-n |
It is said on the Internet that there was once a fast thunder pen question to add users in batches. The procedure is very simple. There is a small knowledge point. Set a password for the user without interaction. There are two solutions: 1. Reverse
Sometimes you need to process some txt files generated in windows under linux, but garbled characters often occur when you view them on the console, because the character sets used by the two operating systems are different by default, in Linux, the
Method 1 (gzexe ):This encryption method is not very safe, but can meet the general encryption purpose, can conceal the password and other information in the script.It uses the built-in gzexe program, which not only encrypts but also compresses
In programming languages, loop statements are one of the most basic syntaxes. In Shell (Bash here), there is no exception. Sort out the content you have previously written.This includes the for/while/until loop and variable auto-increment syntax
The IF/THEN structure determines whether the return value of a piece of code is 0 (according to UNIX conventions, 0 indicates yes). IF it is 0, it executes a specific piece of code;
A Special Command [(that is, left braces) exists in Shell ). He
Useradd. sh
#! /Bin/bash
For name in tom joy john mark james
Do useradd $ name
Echo "redhat" | passwd -- stdin $ name
Done
Now, tom, joy, john, mark, and james are created automatically after the execution, and the passwords are set to
As we mentioned in the preface, although the Apache server is the most widely used, it is designed to be a very secure program. However, Apache also has security defects like other applications. After all, it is the full source code. The security
Asia Pacific Network Information is recorded here and updated every day.
Http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest
The script below will edit the text and output the CIDR blocks of several major carriers in China.
#! /Bin/sh#
In general, we only need to monitor the program process. But this time we encountered such a problem, the company developed the program, the program process is still in progress, but the deadlock. This has caused a wide range of impact. what's even
On average, PHP100 has intrusion or attacks every month. We have done a lot of work. Of course, many experts can still intrude into the PHP100. We are not surprised because we believe that there are people out of the world, although our servers are
This article describes how to modify the default sshd settings to ensure sshd security and restriction, and protect your server from hacker intrusion. Every time you change the sshd configuration file, You Need To Restart sshd. In this way, your
Management because the samba file sharing service is a LAN Service, some people think that security settings are unnecessary, but often you do not have to make the most mistakes, some small things still need to be concerned. Here I will list some
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.