Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Palash Bauri 👻
Palash Bauri 👻

Posted on

     

Explain Awk and Its Uses Like I'm Five

I'm seeing awk is being used in terminals , but What Awk is and how it's used?

I'll Grateful if somebody could teach me about it ❤

Top comments(4)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
abhishekalbert profile image
Abhishek
Always thirsty to learn something new. If you know about me then some treat me as a mentor, some treat me as a career guider, others treat me as his/her colleagues and I treat myself as student & Dev.
• Edited on• Edited

In short :

awk (also written as Awk and AWK) is a utility that enables a programmer to write tiny but effective programs in the form of statements that define text patterns that are to be searched for in each line of a document and the action that is to be taken when a match is found within a line. awk comes with most UNIX-based operating systems such as Linux, and also with some other operating systems, such as Windows 95/98/NT.

An awk program is made up of patterns and actions to be performed when a pattern match is found. awk scans input lines sequentially and examines each one to determine whether it contains a pattern matching one specified by the user. When the matching pattern is found, awk carries out the instructions in the program. For example, awk could scan text for a critical portion and reformat the text contained in it according to the user's command. If no pattern is specified, the program will carry out the command on all of the input data.

WHAT CAN WE DO WITH AWK ?

  1. AWK Operations:
    (a) Scans a file line by line
    (b) Splits each input line into fields
    (c) Compares input line/fields to pattern
    (d) Performs action(s) on matched lines

  2. Useful For:
    (a) Transform data files
    (b) Produce formatted reports

  3. Programming Constructs:
    (a) Format output lines
    (b) Arithmetic and string operations
    (c) Conditionals and loops

for more detail like syntax and coding example

See these link about awk (linux awk command) hope these will be beneficial

hcs.harvard.edu/~dholland/computer...

computerhope.com/unix/uawk.htm

en.wikibooks.org/wiki/AWK

geeksforgeeks.org/awk-command-unix...

this one is a 3 min video :linkedin.com/learning/awk-essentia...

this one is pdf link :-cs.unibo.it/~renzo/doc/awk/nawkA4.pdf

choose which one you feel better these are the top links to learn .

Happy learning.

CollapseExpand
 
bauripalash profile image
Palash Bauri 👻
Your Friendly Neighbourhood 👨‍💻 Scientist , 🛠 Inventor, 📝 Writer.2018 Google Code-in Finalist , Story Writer.Doing Some 🔭 Radio Astronomy.
  • Email
  • Location
    India
  • Education
    Bachelor's Of Arts, English; NSOU, India
  • Joined

Thank You Very Much ❤

CollapseExpand
 
rrampage profile image
Raunak Ramakrishnan
Passionate about databases, distributed systems and functional programming.
  • Location
    India
  • Work
    Principal Software Engineer
  • Joined
CollapseExpand
 
4goodapp profile image
4goodapp
  • Joined

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Your Friendly Neighbourhood 👨‍💻 Scientist , 🛠 Inventor, 📝 Writer.2018 Google Code-in Finalist , Story Writer.Doing Some 🔭 Radio Astronomy.
  • Location
    India
  • Education
    Bachelor's Of Arts, English; NSOU, India
  • Joined

More fromPalash Bauri 👻

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp