Online Linux Terminal Logo
OnlineLinuxTerminal
Traitement de texteCLI Manual

$awk

Pattern scanning and column text processing language.

Syntaxe de la commandePOSIX Standard
awk [OPTIONS] 'program' [FILE...]
Communauté Linux2.4k En ligne

Échangez avec des utilisateurs Linux, apprenez des commandes et téléchargez des PDF.

Essayer en direct dans le bac à sable interactif

Simulation côté client sans installation avec retour instantané.

Ouvrir dans le terminal plein écran ↗
bash — terminal

Aperçu et fonctionnement

`awk` is a complete programming language designed for data extraction and reporting. It treats text files as tables divided into records (lines) and fields (columns delimited by spaces or commas), making it effortless to parse CSVs, log files, and system process tables.

Options et drapeaux courants

Flag / OptionDescription
-F [separator]Define custom field separator character (e.g., -F: for /etc/passwd).
-v [var=val]Assign a value to an internal awk program variable.

Exemples pratiques du monde réel

#1Extract usernames from /etc/passwd
awk -F: '{print $1}' /etc/passwd

Splits lines by colon (:) and prints the first column containing account usernames.