{"id":13587608,"url":"https://github.com/learnbyexample/learn_gnuawk","last_synced_at":"2025-05-15T02:10:37.122Z","repository":{"id":41556207,"uuid":"250762892","full_name":"learnbyexample/learn_gnuawk","owner":"learnbyexample","description":"Example based guide to mastering GNU awk","archived":false,"fork":false,"pushed_at":"2025-04-24T07:10:43.000Z","size":5673,"stargazers_count":1103,"open_issues_count":0,"forks_count":81,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-24T08:24:57.934Z","etag":null,"topics":["awk","command-line","ebooks","exercises","gnu","learn-by-doing","linux","one-liners","regex"],"latest_commit_sha":null,"homepage":"https://learnbyexample.github.io/learn_gnuawk/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/learnbyexample.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-03-28T10:08:11.000Z","updated_at":"2025-04-18T15:49:16.000Z","dependencies_parsed_at":"2022-08-02T16:16:03.360Z","dependency_job_id":"affc92bf-57cf-43e3-bfda-ecd416809dba","html_url":"https://github.com/learnbyexample/learn_gnuawk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/learnbyexample%2Flearn_gnuawk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/learnbyexample%2Flearn_gnuawk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/learnbyexample%2Flearn_gnuawk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/learnbyexample%2Flearn_gnuawk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/learnbyexample","download_url":"https://codeload.github.com/learnbyexample/learn_gnuawk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254259387,"owners_count":22040821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["awk","command-line","ebooks","exercises","gnu","learn-by-doing","linux","one-liners","regex"],"created_at":"2024-08-01T15:06:17.148Z","updated_at":"2025-05-15T02:10:32.109Z","avatar_url":"https://github.com/learnbyexample.png","language":"Shell","readme":"# CLI text processing with GNU awk\n\nLearn GNU awk with hundreds of examples and exercises. Visit https://youtu.be/KIa_EaYwGDI for a short video about the book.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/gawk_ls.png\" alt=\"CLI text processing with GNU awk ebook cover image\" /\u003e\u003c/p\u003e\n\nThe book also includes exercises to test your understanding, which are presented together as a single file in this repo — [Exercises.md](./exercises/Exercises.md).\n\nFor solutions to the exercises, see [Exercise_solutions.md](./exercises/Exercise_solutions.md).\n\nYou can also use [this interactive TUI app](https://github.com/learnbyexample/TUI-apps/blob/main/AwkExercises) to practice some of the exercises from the book.\n\nSee [Version_changes.md](./Version_changes.md) to keep track of changes made to the book.\n\n\u003cbr\u003e\n\n# E-book\n\n* You can purchase the pdf/epub versions of the book using these links:\n    * https://learnbyexample.gumroad.com/l/gnu_awk\n    * https://leanpub.com/gnu_awk\n* You can also get the book as part of these bundles:\n    * **All books bundle** bundle from https://leanpub.com/b/learnbyexample-all-books or https://learnbyexample.gumroad.com/l/all-books\n    * **Magical one-liners** bundle from https://leanpub.com/b/oneliners or https://learnbyexample.gumroad.com/l/oneliners\n    * **Awesome Regex** bundle from https://leanpub.com/b/regex or https://learnbyexample.gumroad.com/l/regex\n* See https://learnbyexample.github.io/books/ for a list of other books\n\nFor a preview of the book, see [sample chapters](./sample_chapters/gnu_awk_sample.pdf).\n\nThe book can also be [viewed as a single markdown file in this repo](./gnu_awk.md). See my blogpost on [generating pdf/epub from markdown using pandoc](https://learnbyexample.github.io/customizing-pandoc/) if you are interested in the ebook creation process.\n\nFor the web version of the book, visit https://learnbyexample.github.io/learn_gnuawk/\n\n\u003cbr\u003e\n\n# Testimonials\n\n\u003eStep up your cli fu with this fabulous intro \u0026 deep dive into awk. I learned a ton of tricks!\n\u003e\n\u003e — [feedback on twitter](https://twitter.com/killchain/status/1246820137455452163)\n\n\u003eI consider myself pretty experienced at shell-fu and capable of doing most things I set out to achieve in either bash scripts or fearless one-liners. However, my awk is rudimentary at best, I think mostly because it's such an unforgiving environment to experiment in.\n\u003e\n\u003eThese books you've written are great for a bit of first principles insight and then quickly building up to functional usage. I will have no hesitation in referring colleagues to them!\n\u003e\n\u003e — [feedback on Hacker News](https://news.ycombinator.com/item?id=31930840)\n\n\u003cbr\u003e\n\n# Feedback and Contributing\n\n⚠️ ⚠️ Please DO NOT submit pull requests. Main reason being any modification requires changes in multiple places.\n\nI would highly appreciate it if you'd let me know how you felt about this book. It could be anything from a simple thank you, pointing out a typo, mistakes in code snippets, which aspects of the book worked for you (or didn't!) and so on. Reader feedback is essential and especially so for self-published authors.\n\nYou can reach me via:\n\n* Issue Manager: [https://github.com/learnbyexample/learn_gnuawk/issues](https://github.com/learnbyexample/learn_gnuawk/issues)\n* E-mail: `echo 'bGVhcm5ieWV4YW1wbGUubmV0QGdtYWlsLmNvbQo=' | base64 --decode`\n* Twitter: [https://twitter.com/learn_byexample](https://twitter.com/learn_byexample)\n\n\u003cbr\u003e\n\n# Table of Contents\n\n1) Preface\n2) Installation and Documentation\n3) awk introduction\n4) Regular Expressions\n5) Field separators\n6) Record separators\n7) In-place file editing\n8) Using shell variables\n9) Control Structures\n10) Built-in functions\n11) Multiple file input\n12) Processing multiple records\n13) Two file processing\n14) Dealing with duplicates\n15) awk scripts\n16) Gotchas and Tips\n17) Further Reading\n\n\u003cbr\u003e\n\n# Acknowledgements\n\n* [GNU awk documentation](https://www.gnu.org/software/gawk/manual/) — manual and examples\n* [stackoverflow](https://stackoverflow.com/) and [unix.stackexchange](https://unix.stackexchange.com/) — for getting answers to pertinent questions on `awk` and related commands\n* [tex.stackexchange](https://tex.stackexchange.com/) — for help on [pandoc](https://github.com/jgm/pandoc/) and `tex` related questions\n* [/r/commandline/](https://old.reddit.com/r/commandline), [/r/linux4noobs/](https://old.reddit.com/r/linux4noobs/), [/r/linuxquestions/](https://old.reddit.com/r/linuxquestions/) and [/r/linux/](https://old.reddit.com/r/linux/) — helpful forums\n* [canva](https://www.canva.com/) — cover image\n* [oxipng](https://github.com/shssoichiro/oxipng), [pngquant](https://pngquant.org/) and [svgcleaner](https://github.com/RazrFalcon/svgcleaner) — optimizing images\n* [Warning](https://commons.wikimedia.org/wiki/File:Warning_icon.svg) and [Info](https://commons.wikimedia.org/wiki/File:Info_icon_002.svg) icons by [Amada44](https://commons.wikimedia.org/wiki/User:Amada44) under public domain\n* [arifmahmudrana](https://github.com/arifmahmudrana) for spotting an ambiguous explanation\n* [Pound-Hash](https://github.com/Pound-Hash) for critical feedback\n* [FabijanC](https://github.com/FabijanC) and [alexwheezy](https://github.com/alexwheezy) for spotting ambiguous descriptions, typos and issues with commands\n* [mdBook](https://github.com/rust-lang/mdBook) — for web version of the book\n    * [mdBook-pagetoc](https://github.com/JorelAli/mdBook-pagetoc) — for adding table of contents for each chapter\n    * [minify-html](https://github.com/wilsonzlin/minify-html) — for minifying html files\n\nSpecial thanks to all my friends and online acquaintances for their help, support and encouragement, especially during difficult times.\n\n\u003cbr\u003e\n\n# License\n\nThe book is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-nc-sa/4.0/).\n\nThe code snippets are licensed under MIT, see [LICENSE](./LICENSE) file.\n\n","funding_links":[],"categories":["Learning resources","Shell"],"sub_categories":["Security"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flearnbyexample%2Flearn_gnuawk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flearnbyexample%2Flearn_gnuawk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flearnbyexample%2Flearn_gnuawk/lists"}