| How To | Platform Name | Command Line | Notes | Actions |
|---|---|---|---|---|
| Use a variable. | AWK | awk 'BEGIN {count = 0} {count++} END {printf "Count is %s\n",count}' /etc/network/interfaces | Count will contain the number of lines in the file, be aware, that, the BEGIN and END keywords are case sensitive. | Edit Delete |
| Remove lines from a text file containing specific text using gawk. | AWK | gawk -i inplace '!/docker/' /etc/.bashrc. | The example shown removes all lines containing "docker" from /etc/.bashrc gawk is an alias of awk... | Edit Delete |
