Created
March 4, 2022 22:06
-
-
Save cobanov/e135638bf3c197dd468e7fe16e7b7de0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Basic Example | |
awk -F: '{print $1, $NF}' /etc/passwd | |
-F:|Colon as a separator | |
{...}|Awk program | |
print|Prints the current record | |
$1|First field | |
$NF|Last field | |
/etc/passwd|Input data file | |
# Variables | |
$0|Whole line | |
$1, $2...$NF|First, second… last field | |
NR|Total Number of Records | |
NF|Nnumber of Fields | |
OFS|Output Field Separator | |
FS|input Field Separator | |
ORS|Output Record Separator | |
RS|input Record Separator | |
FILENAME|Name of the file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment