About 1,110,000 results
Open links in new tab
  1. Difference between gawk vs. awk - Unix & Linux Stack Exchange

    Trying to understand the differences between the two functions gawk vs. awk? When would one use gawk vs awk? Or are they the same in terms of usage? Also, could one provide an example?

  2. bash - Use Awk to extract substring - Stack Overflow

    Nov 23, 2013 · If you want to write an awk script, which portable to any awk implementations and versions (gawk/nawk/mawk...) it is really hard, even if with --posix (gawk) for example: some …

  3. awk - how to print all fields after $5? - Unix & Linux Stack Exchange

    Jan 27, 2025 · awk '{$1=$2=$3=$4=$5="";$0=$0;print}' [path/to/data_file] The first part, $1=$2=$3=$4=$5="" sets the first 5 fields to the empty character. The drawback of this is that …

  4. What are NR and FNR and what does "NR==FNR" imply?

    In Awk: FNR refers to the record number (typically the line number) in the current file. NR refers to the total record number. The operator == is a comparison operator, which returns true when …

  5. How to get the second column from command output?

    Apr 22, 2013 · I intended to use <some_command> | awk '{print $2}' to accomplish this. But the question is, some values in the second column contain space (s), which happens to be the …

  6. linux - using awk with column value conditions - Stack Overflow

    I'm learning awk from The AWK Programming Language and I have a problem with one of the examples. If I wanted to print $3 if $2 is equal to a value (e.g.1), I was using this command …

  7. awk - Assigning system command's output to variable - Stack …

    Sep 18, 2012 · I want to run the system command in an awk script and get its output stored in a variable. I've been trying to do this, but the command's output always goes to the shell and I'm …

  8. AWK: Access captured group from line pattern - Stack Overflow

    Jun 29, 2018 · If I have an awk command pattern { ... } and pattern uses a capturing group, how can I access the string so captured in the block?

  9. unix - How to Sum a column in AWK? - Stack Overflow

    My file is delimited by a comma which gives 64 columns. I extracted the field as shown below: awk '{split($0,a,","); print a[57]}' How can I compute the sum of the values in columns 57 with …

  10. How to print matched regex pattern using awk? - Stack Overflow

    Apr 4, 2011 · Using awk, I need to find a word in a file that matches a regex pattern. I only want to print the word matched with the pattern. So if in the line, I have: xxx yyy zzz And pattern: /yyy/ …