Tag Archives: linux awk

Awk If Else: Multiple Condition Judgment Examples

Awk if else condition judgment statement is to provide command branch control, awk if else syntax: if(condition) { action 1 } else { action 2 } … Continue reading

Posted in Awk Command, Text Processing | Tagged , , , , | 2 Comments

Learn Awk Command: Syntax, Functions, and Examples

Awk is a powerful text processing command for data processing and report generation in Linux/Unix. It supports variables, functions, conditional judgments, and loops. Awk has a three-part workflow: BEGIN, pattern matching, and END. It offers numerous built-in variables and functions, custom functions, and can handle multiple delimiters, substrings, splits, and conditional statements. Examples illustrate common uses. Continue reading

Posted in Awk Command, Text Processing | Tagged , , , , , | 3 Comments

Text Processing Mastery with awk, sed, and grep: Tips, Syntax, and Examples

awk, sed and grep are powerful command-line utilities in Unix-like operating systems, each designed for different text processing tasks. Here’s an overview of each tool along with some examples: Awk awk is a scripting language that is particularly good for … Continue reading

Posted in Text Processing, Awk Command | Tagged , , , | Comments Off on Text Processing Mastery with awk, sed, and grep: Tips, Syntax, and Examples

`AWK` Command Examples for String Matching and Processing In Linux

In Linux, awk is a powerful text processing tool that can be used to match strings and output them. Here are some basic awk command examples for matching strings and outputting related lines or parts of content: This will output … Continue reading

Posted in Text Processing, Awk Command | Tagged , , | Comments Off on `AWK` Command Examples for String Matching and Processing In Linux

Awk time functions: systime, mktime, strftime

Awk time functions: systime, mktime, strftime. systime: systimeGet the timestamp; mktime: Create the timestamp; strftime: Format the time … Continue reading

Posted in Awk Command, Text Processing | Tagged , , | Comments Off on Awk time functions: systime, mktime, strftime

Awk built-in functions: index, match, length

Awk’s built-in string processing function is the one we use most.we share with you: index, match, length Continue reading

Posted in Awk Command, Text Processing | Tagged , , | Comments Off on Awk built-in functions: index, match, length

Awk built-in functions: gsub, sub, substr

Awk’s built-in string processing function is the one we use most. Today, we share with you: gsub, sub, substr. Continue reading

Posted in Awk Command, Text Processing | Tagged , , , , | Comments Off on Awk built-in functions: gsub, sub, substr

awk print function in linux

Awk print function is a built-in function of awk, used for prints its arguments on the standard output (or on a file if > file or >> file is present or on a pipe if | cmd is present). Syntax … Continue reading

Posted in Awk Command, Text Processing | Tagged , , | Comments Off on awk print function in linux

Awk built-in functions – mathematical functions

awk supports the following built-in mathematical functions: atan2, cos, exp, log, sin, and sqrt. Continue reading

Posted in Awk Command, Text Processing | Tagged , , | Comments Off on Awk built-in functions – mathematical functions

Awk built-in variables and custom variables

In awk, variables are divided into two types: built-in variables and user-defined variables. Continue reading

Posted in Awk Command, Text Processing | Tagged , , | Comments Off on Awk built-in variables and custom variables

How to find empty lines in files in Linux

In Linux, there are three ways to find empty lines in files using grep and awk commands. Continue reading

Posted in Awk Command, File & Directory, Text Processing | Tagged , , | Comments Off on How to find empty lines in files in Linux

How to convert a string to lowercase in Linux?

This section describes how to use sed, awk, TR commands to convert strings to lowercase in Linux Continue reading

Posted in Awk Command, Sed Command, Text Processing | Tagged , , , | Comments Off on How to convert a string to lowercase in Linux?

Awk classic case – awk analysis of nginx access logs

Awk classic case – awk analysis of nginx access logs.Count top visits and the number of visits in the most recent time. Continue reading

Posted in Awk Command, Text Processing | Tagged , | Comments Off on Awk classic case – awk analysis of nginx access logs

awk replace statement and examples

Awk replace statement can help us format the input data conveniently. Use of awk string manipulation functions: gsub() Continue reading

Posted in Awk Command, Text Processing | Tagged , , , | Comments Off on awk replace statement and examples

awk tutorial: awk multiple conditions

Awk supports if else conditions judgment, and multiple conditions operations with && (and) or || (or) can be used. Continue reading

Posted in Awk Command, Text Processing | Tagged , , | Comments Off on awk tutorial: awk multiple conditions