Changes between Version 11 and Version 12 of Csle2022/Agenda/linuxpackagemanagement


Ignore:
Timestamp:
Oct 19, 2022, 7:18:11 PM (2 years ago)
Author:
deepthi
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Csle2022/Agenda/linuxpackagemanagement

    v11 v12  
    366366`$ sed '/abc/d' filename.txt`
    367367
    368 
    369 
    370368==== awk ====
     369
     370Awk is a scripting language used for manipulating data and generating reports. The awk command programming language requires no compiling and allows the user to use variables, numeric functions, string functions, and logical operators.
     371
     372Syntax:
     373
     374`awk options 'selection _criteria {action }' input-file > output-file`
     375
     3761. Default behavior of Awk: By default Awk prints every line of data from the specified file. 
     377
     378`$ awk '{print}' employee.txt`
     379
     3802. Print the lines which match the given pattern.
     381
     382`$ awk '/manager/ {print}' employee.txt `
     383
     3843. Splitting a Line Into Fields : For each record i.e line, the awk command splits the record delimited by whitespace character by default and stores it in the $n variables. If the line has 4 words, it will be stored in $1, $2, $3 and $4 respectively. Also, $0 represents the whole line. 
     385
     386`$ awk '{print $1,$4}' employee.txt`
     387
     388
     389
     390
     391
     392
     393
     394
     395
     396
     397