Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Shell three Musketeers' awk report Generator

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Shell three Musketeers

Grep text search tool Global search cut

The sed stream text editor processes it line by line

Awk report Generator Free text formatting tool supports decision array loop

Awk report Generator

Show file name

Display the total number of columns with: as the delimiter

NF represents a column

Display the total number of lines with: as the delimiter

NR represents a line

Print the second line

Display the first three columns with: as delimiter

Display the first three columns of the second row with: as the delimiter

Capture the middle password placeholder x in the first three columns of the second line with: as the delimiter

Another way

$2 represents the second column

BEGIN {}

Executed before the first line of text is read, usually used to initialize the operation

{}

Line by line processing, reading text line by line to perform corresponding processing, is the most common editing instruction block

END {}

Executed after the last line of text is processed, which is usually used to output the processing result

With: separates the column from NAME as the first line, and then outputs the number of rows END as the end line.

The delimited column starts with NAME as the first row and outputs the first column END as the ending row in turn

The delimited column starts with NAME as the first row, and then outputs the first column and the seventh column END as the ending row

The delimited column starts with NAME as the first line and outputs all the contents END as the ending line.

The delimited column starts with NAME as the first line, outputs the first column in turn and displays all the contents empty END as the ending line.

The delimited column starts with NAME as the first line and outputs all the contents in turn with the delimiter: END as the ending line

Show lines ending in bash

Show lines that do not end with bash

Lines that display non-bash ending or nologin content

Show lines that start with r

Show lines that start with amurd

With: delimited columns output the rows of the sixth column ending with bin

To: delimit the rows that output the sixth column up to non-bin

Show / etc/passwd total number of lines

Show administrator users

Show ordinary users

Show user lines that can be logged in

Displays the first three columns of the third row of logged-in users

Show the second column of the third row of the logged-in user

Count the users who can log in in the system

Displays the number of administrator users

Show the number of ordinary users

Displays the number of users who can log in

Output the ip of the eth0 network card

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report