Shell practice: Check whether there are duplicates and extract Duplicated content

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

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 Process Control (condition if, loop for, while)

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

Shell automatically deletes the backup angle n days ago.

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,

Shell checks the system hardware information of online servers.

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

Regularly back up MySQL databases using shell scripts

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

Common Centos Shell skills RE

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

Share the powerful shell commands in daily work

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 |

Shell batch add users

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

Solve Problems Related to opening windowsTXT file garbled characters in CentOS

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

Encrypt shell scripts in CentOS

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

Summary of loop statements in Shell (for, while,)

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

Shell judgment Structure

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

Shell -- batch add users

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

Centos WEB server configuration Security

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

Shell obtains the network segment scripts of major carriers in China.

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#

Shell scripts monitor resources occupied by Nagios plug-ins

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

PHP Website Security Settings on Centos Server

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

Configure Secure SSH on Centos

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

Samba service Security Settings

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

Total Pages: 1330 1 .... 1202 1203 1204 1205 1206 .... 1330 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.