Useful awk command examples

Awk is a powerhouse text tool — it can scan files or streams, match patterns, and run custom actions on the fly, making it perfect for quick data filtering, parsing, and one-line automation

Here are useful awk command examples 😎👇

Find high-res pdf books with all my Linux infographics at https://study-notes.org

#linux #software #softwaredeveloper #technology #upskill

2025/12/4 Edited to

... Read moreAwk is a highly versatile command-line tool commonly used for processing and analyzing text files in Unix-like operating systems. It excels at scanning lines of text, splitting them into fields, pattern matching, and performing custom actions based on these matches. For beginners and experienced users alike, mastering awk commands can significantly speed up text manipulation tasks that would otherwise require lengthy scripts or manual editing. This collection of awk commands covers a wide array of typical use cases. For instance, printing specific fields such as the second and third columns (awk '{print $2, $3}' my.txt) helps extract relevant data quickly. Changing field separators (awk -F"," '{print $2, $3}' my.csv) makes awk flexible to handle CSV or other structured text formats. Filtering lines based on conditions such as numeric comparisons or matching patterns ('awk '$2 > 100'' or 'awk '/error/' my.txt') enables selective data processing. Awk can also perform arithmetic operations and aggregations, such as summing columns or calculating averages, directly during the text scan (e.g., awk '{sum=$1+$2; print sum}' or computing averages with conditions). Adding line numbers (awk '{print NR, $0}') or printing the number of fields per line (awk '{print NF}') are simple yet powerful ways to add structure or debug data. For advanced needs, awk supports defining functions (awk 'function sq(x) {return x*x} {print sq($2)}'), string manipulations like substrings, and case conversions (awk '{print toupper($2)}'). It can also help in log file analysis by filtering lines where the first field matches specific keywords ('awk '$1 == "ERR" {print $2}' my.log) or patterns ('awk '$1 ~ /^[0-9]+$/' my.log). Additionally, awk is useful in removing duplicate lines based on a field ('awk 'seen[$1]++' my.txt) and formatting output for readability (awk '{print "Name:", $1, "Age:", $2}'). This flexibility makes awk a must-have tool for system administrators, developers, and data analysts dealing with text streams or files. In short, by learning these practical awk commands, users gain the ability to rapidly process logs, generate reports, parse CSV files, and automate repetitive text tasks, improving productivity and enabling powerful one-liner shell workflows. Online resources such as the Linux infographics collection available at study-notes.org provide valuable visual guides and cheat sheets to reinforce awk command usage and boost skills in Linux shell programming.

Related posts

Useful sysdig command examples
Sysdig is one of those hidden gem tools that shows exactly what your Linux system is doing in real time — system calls, containers, network traffic, file access — everything, no guessing. Here are useful sysdig command examples 😎👆 Find high-res pdf ebooks with all my cybersecurity related inf
Learn Linux with Dan

Learn Linux with Dan

5 likes

An infographic titled 'Sysdig Command Examples' defines Sysdig as a Linux tracing tool and lists various commands for monitoring CPU, memory, network, file I/O, and capturing events. It's created by Dan Nanni.
Useful sysdig command examples
The sysdig command is a powerful system-level exploration and troubleshooting tool for Linux. Sysdig can capture and analyze real-time system calls and events, enabling deep visibility into processes, containers, network activity, and file access Here are useful sysdig command examples 😎👆 #te
Learn Linux with Dan

Learn Linux with Dan

26 likes

An infographic titled 'Linux netcat Command Examples' lists various `nc` commands for network tasks like port scanning, file transfer, creating shells, and streaming. It includes commands for TCP/UDP, IPv6, and persistent listeners, credited to Dan Nanni.
Useful netcat command examples
Netcat is the Swiss army knife of networking. It lets you read and write data over TCP or UDP, and infosec folks use it all the time for things like quick port scans, grabbing service banners, or setting up reverse shells. Here are useful netstat command examples 😎👆 Find high-res pdf ebooks w
Learn Linux with Dan

Learn Linux with Dan

7 likes

Linux awk command examples
The awk command is a versatile tool for processing text, enabling users to scan files or streams, match patterns, and perform custom actions on the matched data Here are useful examples of the awk command 😎👇 #sysadmin #opensource #devops Find high-res pdf books with all my #Linux
Learn Linux with Dan

Learn Linux with Dan

6 likes

An infographic titled 'Linux curl Command Examples' provides a comprehensive list of curl commands. It covers HTTP GET operations with options like user-agent and custom headers, HTTP POST/PUT operations for data and file uploads, and various file download operations including resuming and rate-limiting. Created by Dan Nanni.
Linux curl command examples
The curl command is a flexible tool that lets you send or receive data from servers using protocols like HTTP, HTTPS, FTP, and others, all from the command line Here are useful curl command examples 😎👆 #devops #opensource #software #TechTips Find high-res pdf books with all my #lin
Learn Linux with Dan

Learn Linux with Dan

7 likes

A laptop screen displays the 'News in Slow Spanish for Beginners' podcast interface, showing 'Lesson 2 - Ser & Estar' and an 'About' section detailing the course structure with dialogues, stories, and quizzes.
A laptop screen shows a list of 'Spanish for Beginners' podcast episodes, including lessons on syntax, past participles, and irregular verbs, with the overlaid text 'perfect pace for those just starting to learn!'.
A laptop screen displays the 'Spanish for Beginners: Lesson 2 - Ser & Estar' podcast episode description, explaining how to decipher the verbs of being, with the overlaid text 'scenarios in Spanish and English'.
Perfect Spanish podcast for beginners
I love this podcast so much!! It’s great for you if you are looking to learn Spanish in a natural, easy way. Each episode covers useful words, phrases, and grammar with clear explanations and real-life examples (both English and Spanish). It’s great for beginners because you get to hear Spanish in
Anaïs D’Ottavio

Anaïs D’Ottavio

1375 likes

Useful notes for Nurse 🩺🫀🫶🏻
#nurse #medicalstudent #school #notes #nursing
Sandra Vasquez

Sandra Vasquez

145 likes

Dirty Cabbage!!! 🔥🔥🤤🤤🤤 #DirtyCabbage #DinnerIdeas #viral #foryoupage #fyp
Jaszi With The Pots 👩🏾‍🍳🩷

Jaszi With The Pots 👩🏾‍🍳🩷

7744 likes

A hand holds a pencil, writing in a notebook, with a laptop in the background. The image is titled "simple but useful writing tips" and indicates to "SWIPE FOR MORE," serving as the cover for an article on writing proficiency.
This slide provides writing tips: avoid 'This/These/It' by being specific, and avoid 'due' by using more descriptive language. Examples show how to rephrase sentences like 'Your rent is due' to 'The rent payment is required by the end of the month.'
This slide offers writing advice: avoid 'based on' and instead use 'on the basis of' for clarity and formality, with an example provided. It also states that sentences should begin and end with words, not symbols, numerals, abbreviations, or acronyms.
Simple but useful tips to write better ✍🏻
📝 Learning to write proficiently is important for effective communication and academic success. Proficient writing enables individuals to convey their thoughts, ideas, and arguments clearly and persuasively. It is a valuable skill in various professional fields, where concise and articulate wri
teal.days

teal.days

131 likes

This image displays a comprehensive list of useful Wireshark filter examples. It includes filters for IP addresses, ports, protocols like TCP, UDP, HTTP, DNS, TLS, DHCP, and packet properties such as length and content. The infographic was created by Dan Nanni from study-notes.org.
Useful Wireshark filter examples
Wireshark filters cut through the noise so you can focus on the traffic that matters: protocols, IPs, ports, or even packet contents. For blue teams, they help track suspicious activity and investigate forensic evidence. For red teams, they help map behavior, spot weak points, and test defenses
Learn Linux with Dan

Learn Linux with Dan

2 likes

An infographic titled "Git Command Essentials" categorizes various Git commands. It covers basic operations, configuration, staging and committing changes, viewing changes, managing branches, managing remote repositories, undoing changes, and miscellaneous commands like merge, rebase, and tag. The infographic is created by Dan Nanni from study-notes.org.
Git command examples
Git is crucial for version control, enabling teams to collaborate, track changes, and manage code reliably in software development projects Here are useful git command examples! 😎👇 #coding #programming #softwaredeveloper #github Find high-res pdf books with all my DevOps related inf
Learn Linux with Dan

Learn Linux with Dan

5 likes

A Linux watch command cheatsheet created by Dan Nanni, listing various commands to monitor system metrics in real-time. Examples include tracking CPU/memory usage, disk space, log file growth, network activity, and system errors, with refresh intervals specified.
Linux watch command cheatsheet
Ever wish you could just run a command and keep seeing it update automatically as things change? That is exactly what the watch command does on Linux Here are useful examples of the watch command 😎👆 Find high-res pdf ebooks with all my Linux related infographics at https://study-notes.org
Learn Linux with Dan

Learn Linux with Dan

5 likes

Helping students succeed without stress 📚 I offer support with proctored exams, TEAS, HESI, PMP, WGU,GED , A&P online courses, essays, and academic papers🎓. If you’re overwhelmed, behind, or just need reliable academic support I’ve got you covered 💯 Payment is after service #helpastuden
GetHelpWithProctoredExam

GetHelpWithProctoredExam

303 likes

Useful Websites You Might Find Helpful Someday
Little lesser-known websites that could prove helpful for various needs in your everyday online activities. I hope you find these valuable. ⟣ Remove Vocals With this tool, you can make karaoke tracks easily. It removes vocals from any song (in wav or mp3 format) that has both instruments and
Reverelia

Reverelia

1292 likes

An infographic titled 'Linux pv Command Examples' presents various `pv` commands for visualizing data transfer progress. Examples include monitoring file copying, merging, compression, decompression, SCP transfers, disk backups, and tarball operations, demonstrating how `pv` shows progress, speed, and ETA during file operations.
Useful pv command examples
pv (Pipe Viewer) is one of those hidden gems on Linux. Just toss it into a pipe (pipes are already super convenient) and you get a live view of progress, speed, and ETA as data flows through 😎👆 Find high-res pdf ebooks with all my Linux related infographics at https://study-notes.org #linux
Learn Linux with Dan

Learn Linux with Dan

3 likes

Linux netcat command examples
The netcat command lets you read from and write to network connections using TCP or UDP. Its flexibility makes it a must-have for infosec professionals, who use it for tasks such as port scanning, banner grabbing, and setting up reverse shells during penetration tests. Here are useful netstat co
Learn Linux with Dan

Learn Linux with Dan

10 likes

A black background image titled "Linux scp Command Examples" lists various scp commands with their functions, including copying files/directories, using custom SSH ports, compression, private keys, rate-limiting, and jump servers. It also features a small circular image with "Created by Dan Nanni study-notes.org".
Scp command examples
The scp command lets you securely copy files between hosts over an SSH connection. Some of you might think scp is deprecated but in fact what’s deprecated is the scp protocol, not the command itself. The command now uses a more secure sftp protocol by default Here are some of useful scp com
Learn Linux with Dan

Learn Linux with Dan

7 likes

GUYS I COOKED??!? #makeupchallenge
miranda rina

miranda rina

5914 likes

how I got started learning Python 🐍💻👾
I’ve been learning Python this summer to prepare for my research lab and courses in the fall. Programming isn’t required for my major, so I’m taking the time to learn it alone. The biggest tip I can give is specific goals from the beginning! Speaking from experience, this will save a lot of time an
reagan

reagan

43 likes

This image displays "Useful Linux Cron Examples," a comprehensive list of cron job schedules. It shows various cron expressions with corresponding commands and descriptions for tasks like running every minute, hourly, daily, weekly, monthly, yearly, at system startup, and more, created by Dan Nanni.
Useful Linux cron examples
Linux cron schedules recurring tasks at defined times using flexible expressions for minutes, hours, days, and months Here are useful cron job examples 😎👇 #software #softwaredeveloper #TechTips #technicalinterview Find a high-res pdf book with all my #linux related infographics fro
Learn Linux with Dan

Learn Linux with Dan

7 likes

Linux command chaining
Linux shells like bash and zsh make it easy to combine commands using chaining, command substitution, and process substitution, letting you run tasks in sequence, reuse command output, or connect commands more flexibly 😎👆 Find a high-res pdf ebook with all my Linux related infographics from http
Learn Linux with Dan

Learn Linux with Dan

2 likes

Awk 😅
Lemon8er

Lemon8er

2 likes

Tools I use to learn Mandarin #creatorsearchinsights #mandarin #chinese #china #learning
TheForeignerLife

TheForeignerLife

1 like

2012 BOSS 302
The performance and handling in the Mustang BOSS 302 is incredible. Ford put the best of all of them into these cars. #ford #mustang #BOSS
Motorhood_George

Motorhood_George

21 likes

An infographic titled 'Linux lsof Command Examples' by Dan Nanni, detailing various uses of the lsof command. It categorizes examples for listing open files, network connections and sockets, and other usages like Unix domain sockets and killing user activities.
Linux lsof command examples
My underrated Linux pick is the lsof command. It tells you exactly which files are open and which processes are using them. Because Linux treats everything as a file, this tiny command ends up being insanely powerful and useful in everyday troubleshooting. Here are useful lsof command examples 😎
Learn Linux with Dan

Learn Linux with Dan

2 likes

An infographic titled 'Ways to Remove Files on Linux' presents a comprehensive list of commands for deleting files and directories. It includes various `rm` commands for basic removal, `find` commands for conditional deletion based on criteria like age, size, user, or permissions, and other utilities like `unlink`, `shred`, and `trash-put`. The infographic is created by Dan Nanni from study-notes.org.
Different ways to remove files on Linux
There are various ways to remove files and directories on Linux, based on filenames, creation/access time, size, ownership, permissions, or security needs Here are useful command line examples of removing files on Linux 😎👆 #infosec #TechTips #software Find high-res pdf books with a
Learn Linux with Dan

Learn Linux with Dan

10 likes

A scenic view of a city along a river with buildings, bridges, and mountains under a clear blue sky. The foreground features a bridge railing covered in numerous love locks. The image introduces the topic with the text 'FRENCH word of the DAY'.
A light brown graphic displaying the French phrase 'pas mal' with its phonetic pronunciation '[pah-mahl]' and English translation 'not bad'. An example sentence in French and English illustrates its usage: 'the concert was not bad, but I preferred the last one'.
A light brown graphic titled 'EXAMPLES' showing a dialogue in French and English. It demonstrates the use of 'Pas mal' in a conversation about a movie: 'A: How was the movie? B: Not bad, but a bit long'.
useful french phrase to know!
"Pas mal" is a casual way to say something is "not bad" without sounding too excited or too negative. It’s great for giving neutral opinions like about food, movies, or experiences, etc. It can also mean "quite a lot" in some cases, like "Il y avait pas mal de monde"
Anaïs D’Ottavio

Anaïs D’Ottavio

43 likes

(Masking is something both neurotypical and neurodivergent people do! People with ADHD and/or on the Autism spectrum tend to mask more often to fit in— especially women because of societal expectations, which contributes to ADHD often going unnoticed in women and girls.) #adhdinwomen #adhdmaskin
ADHD Coach Kelly

ADHD Coach Kelly

5 likes

Linux journalctl command examples
The journalctl command lets you view and manage logs collected by systemd’s centralized logging system across the whole machine Here are useful journalctl command examples 😎👇 #sysadmin #technology #software Find high-res pdf books with all my #Linux related infographics at https://st
Learn Linux with Dan

Learn Linux with Dan

5 likes

Linux lsof command examples
If I had to pick a personal favorite among lesser-known Linux commands, it would be lsof. It’s my go-to tool for discovering which files are open and which processes are using them. Since everything in Linux is treated as a file, lsof proves to be surprisingly powerful and endlessly useful Here
Learn Linux with Dan

Learn Linux with Dan

3 likes

#sportnews #caitlinclark #wnba
Life Stories

Life Stories

0 likes

This image displays a comprehensive list of Tcpdump command examples for network traffic analysis on Linux. It covers various functionalities like capturing, filtering by interface, protocol, IP, port, and subnet, saving to files, displaying detailed packet information, and advanced filtering using TCP flags and VLANs.
Tcpdump command examples
Tcpdump is a powerful command-line tool for capturing and analyzing network traffic on Linux. This tool is essential for cybersecurity pros and sysadmins to troubleshoot issues, inspect protocols, and detect suspicious activity Here are useful tcpdump command examples 😎👆 #technology #softwar
Learn Linux with Dan

Learn Linux with Dan

7 likes

yes i was a very ambitious highschooler
Julie Wise

Julie Wise

38 likes

An infographic titled 'Linux cp Command Examples' presents a comprehensive list of `cp` command variations and their uses, including copying files, directories, preserving attributes, handling symbolic links, and using `find` and `rsync` for advanced copying tasks. The content is created by Dan Nanni.
Linux cp command examples
Many of you probably learned the cp command early on in Linux, but if you haven’t explored its full set of options and are too lazy to read its man page, you might be missing out on its true power Let’s review some useful examples of the command 😎👆 #softwareengineer #softwaredeveloper #sof
Learn Linux with Dan

Learn Linux with Dan

8 likes

An infographic titled "Linux strace Command Examples" defines strace as a Linux diagnostic tool. It lists various strace commands for tracing system calls, logging output, attaching to processes, filtering by syscalls, monitoring child processes, displaying timestamps, and generating syscall summaries. It is created by Dan Nanni.
Linux strace command examples
strace is a Linux diagnostic tool that traces system calls and signals made by a process to help debug and analyze its interaction with the kernel Here are useful strace command examples 😎👇 #cybersecurity #infosec #software #technology Find a high-res pdf book with all my #linux re
Learn Linux with Dan

Learn Linux with Dan

4 likes

ignore my awk 14 wk baby bump .. & a few nights before this I got locked in a bathroom stall soo #relatable #imjustagirl
LC

LC

65 likes

Witcher attack
Faaawk #cosplay #thewitcher #transition
Holszie

Holszie

8 likes

🌿Learn Arabic the Easy Way
Welcome! 👋 This page helps beginners learn Arabic easily and step by step. Here you’ll find: • Essential vocabulary for daily life • Simple pronunciation • Writing practice (letters & words) • Useful daily sentences • Clear examples with English explanations Feel free to ask questio
Arabic Made Easier

Arabic Made Easier

1 like

Linux command chaining
POSIX-compliant Linux shells (bash, zsh, sh) support command chaining — a simple way to link multiple commands and control whether the next one runs based on success, failure, or just order of execution 😎👆 Find a high-res pdf book with all my Linux related infographics from https://study-notes.o
Learn Linux with Dan

Learn Linux with Dan

6 likes

An infographic titled 'Linux ip Command Examples' provides a quick reference for various `ip` subcommands. It details commands for managing IP addresses (`ip addr`), network interfaces (`ip link`), network routes (`ip route`), ARP neighbors (`ip neigh`), and tunnels (`ip tunnel`), including IPv6 options.
Linux ip command examples
The ip command in Linux is a powerful tool used to configure and manage network interfaces, routing tables, and network policies. It serves as a modern replacement for older commands such as ifconfig and route Here are useful ip command examples 😎👆 #technology #networking #cybersecurity
Learn Linux with Dan

Learn Linux with Dan

3 likes

Study Sessions & Time Spent
Start building good habits now, before it’s too late! ⏰ 💕✨🌸 #studyinghabits #get good grades #studytok
💕its ija 429✨

💕its ija 429✨

79 likes

A cozy study desk with a tablet, mug, drink can, and a book titled 'LA PÂTISSERIE'. Text overlay reads 'STUDY TRICKS I USE DAILY VS EXAM SEASON'.
A split image showing 'Active Recall' methods. The 'Hardcore' side describes intense flashcard sessions, while the 'Soft' side details casual quizzing or verbal explanations.
A split image illustrating 'Pomodoro' techniques. The 'Hardcore' side shows a tablet timer for 25/5 focus rounds. The 'Soft' side shows a person studying, describing flexible timing and breaks.
Common Study Methods I Use — Hardcore vs. Soft
📖 Active Recall Hardcore version: I power through over 100 flashcards in one sitting, no peeking at notes, strict time limits, and review every wrong answer immediately. I do this in the final stretch before an exam. Soft version: I casually quiz myself while reviewing notes, or explain what I le
emilie.studygram

emilie.studygram

146 likes

Useful Linux ps command examples
While the ps command is one of the most often used Linux utilities, many of you may not fully utilize its capabilities due to its complex and often confusing syntax Here are a list of useful ps command examples 😎👆 Find high-res pdf books with all my #Linux related infographics at https://st
Learn Linux with Dan

Learn Linux with Dan

2 likes

Millie's cutest moments in her childhood, no wonder she is so popular! #funny #usa🇺🇸 #celebrity #millie #singing
happy.hour02

happy.hour02

14 likes

An infographic titled "Linux pv Command Examples" illustrates various uses of the `pv` command. It shows how to monitor file copying, merging, compression, decompression, SCP transfers, disk partition backups/restores, limit transfer speeds, and manage tarball creation/extraction with progress visualization.
Linux pv command examples
The pv command is a handy but lesser-known tool that lets you monitor the progress of data through a pipe, displaying transfer speed, ETA, and total size. It’s often used with commands like tar, dd, or gzip to track the progress of file transfers, backups, or compression tasks Here are useful Li
Learn Linux with Dan

Learn Linux with Dan

3 likes

📚 Enteral Routes of Medication Administration – NCLEX/Pharm Review When medications are given via the enteral route, they pass through the GI tract and are absorbed at different rates depending on the route. This includes oral (PO), sublingual, buccal, and rectal administration — and understanding
The Nurse Lab

The Nurse Lab

80 likes

A woman with dark hair in a high ponytail, wearing a checkered dress, leans against a light brown wall. Text overlay reads "FRENCH word of the DAY." A hanging potted cactus is visible on the right. The bottom left corner shows "Lemon8 @bonjour.anais."
A light yellow and green gradient background displays the French phrase "ça marche" with its phonetic pronunciation "[sah m(ah)rche]" and English translation "that works." An example sentence, "D'accord, ça marche!" (Alright, that works/sounds good!), is also shown. "Lemon8 @bonjour.anais" is at the bottom.
A light yellow and green gradient background presents two examples of using "ça marche." The first is "On se retrouve à 18h ? Oui, ça marche!" (Are we meeting at 6 PM? Yes, that works!). The second is "Je t'envoie les documents ce soir. Ça marche" (I am sending you the documents this evening. That works). "Lemon8 @bonjour.anais" is at the bottom.
Useful French phrase to know
Knowing "Ça marche!" is super useful because it’s a common and pretty natural/casual way to express agreement in French. You can use it essentially as a way to confirm something – exactly in any instance that you would respond “that works or sounds good”. You can use it casually with friend
Anaïs D’Ottavio

Anaïs D’Ottavio

48 likes

peak awk is someone walked in #outfitinspo #workoutfits #chicstyle #fallfashion #workstyle
Syd

Syd

4 likes

#gettoknowme #ApexLegends #xmodestgamerx #gamertag #gamer #bo6 #cod #howtostream #fyp #foryoupage #pc #pcgaming #Xbox #ps5
xModestGamerx

xModestGamerx

3 likes

mark Jones

mark Jones

71 likes

#fyp #momtok #mom
momma kenn

momma kenn

9 likes

An infographic titled 'Linux socat Command Examples' presents 14 practical `socat` commands for various networking tasks, including TCP, UDP, SSL/TLS, UNIX sockets, and file operations. It was created by Dan Nanni from study-notes.org.
Linux socat command examples
Ever heard of socat? It’s one of those Linux tools that quietly does everything. You can use it to pipe data between almost any two things: TCP, UDP, SSL/TLS, UNIX sockets, files, even serial ports. Pentesters love it for reverse shells, port forwarding, and quick network tests. Here are useful
Learn Linux with Dan

Learn Linux with Dan

5 likes

See more