Top "Awk" questions

AWK is an interpreted programming language designed for text processing and typically used as a data extraction and reporting tool.

Insert multiple lines into a file after specified pattern using shell script

I want to insert multiple lines into a file using shell script. Let us consider my input file contents are: …

linux bash shell sed awk
Saving awk output to variable

Can anyone help me out with this problem? I'm trying to save the awk output into a variable. variable = `ps …

linux bash shell awk centos
Printing with sed or awk a line following a matching pattern

Question: I'd like to print a single line directly following a line that contains a matching pattern. My version of …

awk sed
Calling an executable program using awk

I have a program in C that I want to call by using awk in shell scripting. How can I …

shell awk
Using grep to search for hex strings in a file

I have been trying all day to get this to work. Does anyone know how to get grep, or something …

bash awk grep xargs dd
How to delete duplicate lines in a file without sorting it in Unix?

Is there a way to delete duplicate lines in a file in Unix? I can do it with sort -u …

unix shell scripting sed awk
grep for multiple strings in file on different lines (ie. whole file, not line based search)?

I want to grep for files containing the words Dansk, Svenska or Norsk on any line, with a usable returncode (…

bash awk grep
How can I delete a newline if it is the last character in a file?

I have some files that I'd like to delete the last newline if it is the last character in a …

linux perl shell awk sed
Command line: search and replace in all filenames matched by grep

I'm trying to search and replace a string in all files matched by grep: grep -n 'foo' * will give me …

linux perl awk sed grep
Remove non-ASCII characters from CSV

I want to remove all the non-ASCII characters from a file in place. I found one solution with tr, but …

sed awk