{"id":17369,"date":"2026-01-28T16:30:45","date_gmt":"2026-01-28T11:00:45","guid":{"rendered":"https:\/\/www.youstable.com\/blog\/?p=17369"},"modified":"2026-01-28T16:31:04","modified_gmt":"2026-01-28T11:01:04","slug":"awk-command","status":"publish","type":"post","link":"https:\/\/www.youstable.com\/blog\/awk-command","title":{"rendered":"Awk Command Explained With Practical Examples in 2026"},"content":{"rendered":"\n<p><strong>The awk command is<\/strong> a powerful text processing utility in Unix\/Linux that scans line by line, splits text into fields, and executes pattern action rules to filter, transform, and summarize data. <\/p>\n\n\n\n<p>It excels at quick one liners for parsing logs, CSVs, and system outputs, making it essential for DevOps, SREs, and data wrangling on the command line. If you work on Linux servers or manage code deployments, learning the awk command is one of the highest leverage skills you can acquire. <\/p>\n\n\n\n<p>This beginner friendly guide explains awk step by step with practical examples, from simple printing to real world log analysis. You\u2019ll also learn tips that pros use daily across hosting and cloud environments.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"what-is-the-awk-command\">What is the awk Command?<\/h2>\n\n\n\n<p><strong>awk is a pattern driven <\/strong>processing language available on most Unix like systems (Linux, macOS, BSD). <\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"720\" src=\"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2026\/01\/What-is-the-awk-Command.jpg\" alt=\"Awk Command\" class=\"wp-image-17571\" srcset=\"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2026\/01\/What-is-the-awk-Command.jpg 1280w, https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2026\/01\/What-is-the-awk-Command-150x84.jpg 150w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><\/figure>\n\n\n\n<p>Named after its creators (Aho, Weinberger, Kernighan), it reads input line by line (records), splits each into fields, and runs actions when patterns match. It\u2019s ideal for extracting columns, filtering rows, computing aggregates, and building quick reports.<\/p>\n\n\n\n<p>Unlike sed or grep, awk understands \u201ccolumns\u201d natively and supports variables, arrays, conditionals, and functions enough power to replace small scripts while staying lightweight and fast.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"awk-syntax-and-basics\">awk Syntax and Basics<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"pattern-action-structure\">Pattern Action Structure<\/h3>\n\n\n\n<p><strong>At its core, awk programs are<\/strong> a list of pattern { action } rules. awk executes the action only for lines where the pattern matches. Without a pattern, the action runs for all lines. Without an action, the default is to print matched lines.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>awk 'pattern { action }' file\nawk '{ print $0 }' file          # print every line (default action shown explicitly)\nawk '\/error\/' file               # print lines matching regex \"error\"\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"fields-records-and-delimiters\">Fields, Records, and Delimiters<\/h3>\n\n\n\n<p><strong>awk splits each line (record)<\/strong> into fields using a delimiter. By default, the field separator (FS) is any whitespace. Fields are accessible as $1, $2, \u2026, and the whole line is $0. You can change FS via -F or inside a BEGIN block.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># space-separated\nawk '{ print $1, $3 }' data.txt\n\n# comma-separated (CSV-like)\nawk -F, '{ print $1, $3 }' data.csv\n\n# set output field separator for pretty printing\nawk -F, 'BEGIN{ OFS=\"\\t\" } { print $1, $3 }' data.csv\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"useful-built-in-variables\">Useful Built in Variables<\/h3>\n\n\n\n<p><strong>Common built-ins you\u2019ll use all the time:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>NR:<\/strong> current record (line) number<\/li>\n\n\n\n<li><strong>FNR: <\/strong>current record number in the current file<\/li>\n\n\n\n<li><strong>NF:<\/strong> number of fields on the current line<\/li>\n\n\n\n<li><strong>FS\/OFS:<\/strong> input\/output field separator<\/li>\n\n\n\n<li><strong>RS\/ORS:<\/strong> input\/output record separator<\/li>\n\n\n\n<li><strong>$0:<\/strong> entire line; $1..$NF: fields<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code># print line number and first field\nawk '{ print NR, $1 }' file\n\n# print last field of each line\nawk '{ print $NF }' file\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"getting-started-essential-awk-examples\">Getting Started: Essential awk Examples<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"print-columns-and-reorder\">Print Columns and Reorder<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Reorder fields 3 and 1; add a dash between\nawk '{ print $3 \"-\" $1 }' access.log\n\n# Print specific columns from top output (skip header)\ntop -b -n1 | awk 'NR&gt;7 { print $1, $9, $12 }'\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"filter-rows-by-value-or-regex\">Filter Rows by Value or Regex<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Lines where 3rd field equals \"FAILED\"\nawk '$3==\"FAILED\"' audit.log\n\n# Requests returning 500 status code in Nginx access log (status is $9 or $8 depending on format)\nawk '$9==500' \/var\/log\/nginx\/access.log\n\n# Regex match: case-insensitive search for \"timeout\"\nawk 'tolower($0) ~ \/timeout\/' app.log\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"calculate-sums-averages-and-min-max\">Calculate Sums, Averages, and Min\/Max<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Sum the 2nd column\nawk '{ sum += $2 } END { print sum }' metrics.txt\n\n# Average of column 4 (skip lines starting with #)\nawk '$0 !~ \/^#\/ { n++; total += $4 } END { if (n&gt;0) print total\/n }' data.txt\n\n# Track min and max\nawk 'NR==1{min=max=$2} { if($2&lt;min)min=$2; if($2&gt;max)max=$2 } END{ print \"min\",min,\"max\",max }' stats.txt\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"count-unique-values-and-frequencies\">Count Unique Values and Frequencies<\/h3>\n\n\n\n<p>Associative arrays make grouping trivial.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Count requests per IP (IP assumed to be $1)\nawk '{ hits&#91;$1]++ } END { for (ip in hits) print hits&#91;ip], ip }' access.log | sort -nr | head\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"work-with-csv-and-custom-delimiters\">Work With CSV and Custom Delimiters<\/h3>\n\n\n\n<p><strong>For simple CSV (no quoted commas)<\/strong>, -F, works. For more complex CSV, gawk\u2019s FPAT can help match fields as tokens rather than splitting on commas.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Basic CSV, print columns 1 and 3\nawk -F, 'BEGIN{OFS=\",\"} {print $1, $3}' users.csv\n\n# gawk: handle commas inside quotes (basic FPAT pattern)\ngawk 'BEGIN{ FPAT = \"(&#91;^,]*)|(\\\"&#91;^\\\"]+\\\")\"; OFS=\",\" } { print $1, $3 }' users.csv\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"use-begin-and-end-blocks\">Use BEGIN and END Blocks<\/h3>\n\n\n\n<p><strong>BEGIN runs before reading input;<\/strong> END runs after all lines are processed handy for headers, summaries, and setting FS\/OFS once.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>awk 'BEGIN{ print \"User,Count\" } { c&#91;$1]++ } END{ for (u in c) print u, c&#91;u] }' log.txt\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"practical-real-world-use-cases\">Practical Real World Use Cases<\/h3>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"analyze-web-server-logs-apache-nginx\">Analyze Web Server Logs (Apache\/Nginx)<\/h2>\n\n\n\n<p><strong>Ops teams routinely use awk to<\/strong> troubleshoot traffic, performance, and security. Examples assume a common combined log format; adjust field numbers to your actual format.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Top 10 IPs by request volume\nawk '{ ip=$1; hits&#91;ip]++ } END{ for(ip in hits) print hits&#91;ip], ip }' access.log | sort -nr | head -10\n\n# Top 10 requested URLs (path often $7)\nawk '{ path=$7; c&#91;path]++ } END{ for(p in c) print c&#91;p], p }' access.log | sort -nr | head -10\n\n# Status code distribution (status often $9)\nawk '{ sc=$9; c&#91;sc]++ } END{ for(s in c) print s, c&#91;s] }' access.log | sort -k1,1\n\n# Total bytes sent (bytes often $10)\nawk '$10 ~ \/^&#91;0-9]+$\/ { bytes += $10 } END { print \"Total bytes:\", bytes }' access.log\n<\/code><\/pre>\n\n\n\n<p><strong>Pipe awk output to sort,<\/strong> uniq, or head for quick reports. Combine with grep to pre-filter dates or virtual hosts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"monitor-system-and-app-metrics\">Monitor System and App Metrics<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># CPU usage from mpstat: average user+system\nmpstat 1 5 | awk '\/Average\/ { print \"CPU %usr+%sys:\", $3 + $5 }'\n\n# Memory usage from \/proc\/meminfo\nawk '\/MemTotal\/ {t=$2} \/MemAvailable\/ {a=$2} END{ printf \"Mem Used: %.2f%%\\n\", (t-a)\/t*100 }' \/proc\/meminfo\n\n# Slow queries over 2s in application log (assuming duration is field 6 in seconds)\nawk '$6+0 &gt; 2 { print }' app.log\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"clean-and-transform-data\">Clean and Transform Data<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Normalize case and trim extra spaces\nawk '{ gsub(\/^ +| +$\/,\"\"); $0=tolower($0); print }' raw.txt\n\n# Replace delimiter: tabs to commas\nawk 'BEGIN{ OFS=\",\"; FS=\"\\t\" } { print $1,$2,$3 }' input.tsv &gt; output.csv\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"join-awk-with-other-cli-tools\">Join awk With Other CLI Tools<\/h3>\n\n\n\n<p><strong>awk shines in pipelines.<\/strong> It complements grep (pre-filtering), sort (ordering), uniq (dedupe), and sed (text substitution). Use each tool for what it\u2019s best at to keep commands small and readable.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"advanced-awk-techniques\">Advanced awk Techniques<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"grouping-and-aggregation-by-keys\">Grouping and Aggregation by Keys<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Revenue per customer (customer_id in $1, amount in $3)\nawk -F, '{ rev&#91;$1] += $3 } END { for (id in rev) printf \"%s,%0.2f\\n\", id, rev&#91;id] }' sales.csv | sort -t, -k2,2nr | head\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"range-patterns-and-multi-file-processing\">Range Patterns and Multi file Processing<\/h3>\n\n\n\n<p><strong>Range patterns match from<\/strong> one condition to another; FNR resets per file, NR is global across all files.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Print lines between markers\nawk '\/BEGIN_REPORT\/,\/END_REPORT\/' app.log\n\n# Compare corresponding lines across files\nawk 'FNR==NR { a&#91;$1]=$2; next } { print $0, a&#91;$1] }' left.txt right.txt\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"functions-conditionals-and-arrays\">Functions, Conditionals, and Arrays<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Derive buckets with if\/else and functions\nawk '{\n  score=$2\n  if (score&gt;=90) grade=\"A\"\n  else if (score&gt;=80) grade=\"B\"\n  else grade=\"C\"\n  print toupper($1), grade, length($1)\n}' grades.txt\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"performance-and-portability-tips\">Performance and Portability Tips<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Prefer simple patterns<\/strong> and minimal gsub calls on huge files.<\/li>\n\n\n\n<li><strong>Use numeric comparisons<\/strong> (e.g., $3+0 &gt;= 100) to avoid string semantics.<\/li>\n\n\n\n<li><strong>Set FS\/OFS<\/strong> once in BEGIN for consistency.<\/li>\n\n\n\n<li><strong>For very large data<\/strong>, stream to external sort for heavy ordering.<\/li>\n\n\n\n<li><strong>Stick to POSIX awk<\/strong> for portability; use gawk features (FPAT, asort) when needed.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"common-pitfalls-and-best-practices\">Common Pitfalls and Best Practices<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Quoting:<\/strong> Wrap awk programs in single quotes to prevent the shell from expanding characters. Escape single quotes carefully.<\/li>\n\n\n\n<li><strong>Field numbers:<\/strong> Log formats differ; verify which column holds status, path, or bytes in your environment.<\/li>\n\n\n\n<li><strong>CSV complexity: <\/strong>Real CSVs include quoted commas and newlines; for robust CSV, consider gawk with FPAT or specialized tools like Miller.<\/li>\n\n\n\n<li><strong>Locale:<\/strong> Sorting and case conversion may vary with locale. Set LC_ALL=C for predictable behavior.<\/li>\n\n\n\n<li><strong>Testing: <\/strong>Start with a small sample (head) and add conditions incrementally.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"awk-vs-sed-vs-grep-when-to-use-which\"><strong>awk vs sed vs grep: When to Use Which<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Use grep to find<\/strong> lines that match a pattern <strong>(fast filtering)<\/strong>.<\/li>\n\n\n\n<li><strong>Use sed to substitute<\/strong> or edit text in place <strong>(stream editor)<\/strong>.<\/li>\n\n\n\n<li><strong>Use awk to parse fields,<\/strong> compute values, group, and summarize (<strong>structured processing)<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p><strong>Grep to narrow input<\/strong>, awk to compute, sed to clean output. This pipeline first mindset keeps command lines efficient and maintainable.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"how-awk-helps-hosting-and-devops-teams\"><strong>How awk Helps Hosting and DevOps Teams<\/strong><\/h2>\n\n\n\n<p>From spotting abusive IPs to quantifying 5xx spikes, awk lets you turn raw logs into answers in seconds no heavy tooling needed. In hosting environments, this speed accelerates incident response, capacity planning, and performance tuning, especially when SSH\u2019d into production servers with limited resources.<\/p>\n\n\n\n<p>At <strong><a href=\"https:\/\/www.youstable.com\/\">YouStable<\/a><\/strong>, our managed hosting and <strong><a href=\"https:\/\/www.youstable.com\/vps-hosting\/\">VPS<\/a><\/strong> customers often ask for practical observability without complex stacks. awk, along with standard Linux tools, provides immediate insight. <\/p>\n\n\n\n<p>If you want proactive monitoring, optimized web stacks, and hands on support that speaks your language, our team can help you operationalize these techniques at scale.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"more-practical-awk-one-liners-youll-reuse\">More Practical awk One Liners You\u2019ll Reuse<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code># Remove duplicate lines while keeping first occurrence\nawk '!seen&#91;$0]++' file.txt\n\n# Show lines with more than N fields (e.g., malformed)\nawk 'NF &gt; 10' data.txt\n\n# Add header to computed report\nawk 'BEGIN{print \"status,count\"} {c&#91;$9]++} END{for(s in c) print s \",\" c&#91;s]}' access.log\n\n# Extract date (first field) and count per day\nawk '{ d=$1; gsub(\/\\&#91;|\\]\/,\"\",d); day=substr(d,1,11); hits&#91;day]++ } END{ for (k in hits) print hits&#91;k], k }' access.log | sort -nr\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"faqs\">FAQs<\/h2>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1768279643322\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \" class=\"rank-math-question \" id=\"what-is-the-awk-command-used-for-in-linux\">What is the awk command used for in Linux?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p><strong>awk is a text processing language<\/strong> for scanning files line by line, splitting lines into fields, and running pattern action rules. It\u2019s used to extract columns, filter rows, compute statistics, generate reports, and transform data especially from logs, CSVs, and command outputs.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1768279650808\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \" class=\"rank-math-question \" id=\"how-do-i-print-specific-columns-with-awk\">How do I print specific columns with awk?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p><strong>Use $1, $2, \u2026 to reference fields.<\/strong> For CSVs, set -F, and optionally OFS for output. Example: awk -F, &#8216;BEGIN{OFS=&#8221;,&#8221;} {print $1,$3}&#8217; file.csv prints the first and third columns as comma separated output.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1768279658311\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \" class=\"rank-math-question \" id=\"what-is-the-difference-between-nr-and-fnr-in-awk\">What is the difference between NR and FNR in awk?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p><strong>NR is the total line<\/strong> count across all input files; it keeps increasing. FNR is the line count within the current file and resets to 1 when awk starts a new file. Use FNR==NR patterns to build lookup maps from the first file, then process the second.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1768279665088\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \" class=\"rank-math-question \" id=\"can-awk-handle-complex-csv-files-with-quoted-commas\">Can awk handle complex CSV files with quoted commas?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p><strong>Basic awk with<\/strong> -F, struggles when fields contain commas within quotes. gawk improves this via FPAT to define fields as tokens. For fully robust CSV (escaped quotes, newlines), consider dedicated tools like Miller or xsv.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1768279671074\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \" class=\"rank-math-question \" id=\"which-is-better-awk-sed-or-grep\">Which is better: awk, sed, or grep?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p><strong>They solve different problems<\/strong>. grep searches, sed edits streams, and awk parses and computes. For structured analysis (columns, grouping, sums), awk is best. Combine them in pipelines for the most efficient, readable command lines.<\/p>\n<p><strong>Mastering the awk command<\/strong> will pay off quickly in any Linux, DevOps, or hosting workflow. Keep these examples handy, adapt them to your log formats, and you\u2019ll turn raw text into actionable insight in seconds.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>The awk command is a powerful text processing utility in Unix\/Linux that scans line by line, splits text into fields, [&hellip;]<\/p>\n","protected":false},"author":21,"featured_media":18155,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[350],"tags":[],"class_list":["post-17369","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledgebase"],"acf":[],"featured_image_src":"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2026\/01\/Awk-Command-Explained-With-Practical-Examples.jpg","author_info":{"display_name":"Sanjeet Chauhan","author_link":"https:\/\/www.youstable.com\/blog\/author\/sanjeet"},"_links":{"self":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/17369","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/comments?post=17369"}],"version-history":[{"count":13,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/17369\/revisions"}],"predecessor-version":[{"id":18156,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/17369\/revisions\/18156"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/media\/18155"}],"wp:attachment":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/media?parent=17369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/categories?post=17369"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/tags?post=17369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}