The AWK utility is a data extraction and reporting tool that uses a data-driven scripting language consisting of a set of actions to be taken against textual data (either in files or data streams) for the purpose of producing formatted reports.

learn more… | top users | synonyms

3
votes
2answers
2k views

Color awk output on commandline?

When i process a logfile in awk, is there a possibility to colorize the output on commandline?
0
votes
2answers
2k views

sed/awk: extract one number from string

I have many lines like the following being returned from a bash command, with different sourceNodeIds of varying digit lengths: <NodeAssociation sourceNodeId="33654" [...] sourceNodeEntity="Issue" ...
0
votes
1answer
449 views

How can i Move or copy files (or folder) from solaris server to removable disk.(Backup Tape drive)

i need to move or copy some zip(.tar,.gz,.Z) files from solaris server to Backup tape drive and also i want to retrive from tapedrive when ever i want without any loss. kindly expain the procedure. i ...
3
votes
1answer
157 views

Unexpected Awk results with sh -c

I am trying to sudo a command that uses Awk, and it looks like awk works differently inside sh -c. echo '1 2' | awk '{print $2}' 2 sh -c "echo '1 2' | awk '{print $2}'" 1 2 Why is this ...
0
votes
2answers
709 views

Parse java console output with awk

I'm trying to use awk to parse an output generated by a java application, but it isn't working. It seems that the command after the pipe isn't able to get/see the data throwed by the java app. I'm ...
0
votes
2answers
2k views

Is it possible to insert data from AWK into MySQL

Can i use mySQL from inside awk code Basically i want the data AWKED in this post into Mysql database
3
votes
5answers
2k views

Is it worth while to learn Awk?

I am decent with bash scripting and I am catching on to regex, and a little sed usage. Is learning awk still worth while with all the alternatives out there. Opinions?
4
votes
2answers
236 views

Perl search & replace

How can I use search and replace to change the contents of a file. I need to be able to change the 'all to none' and/or 'none to all' without having to manually do it every time for hundreds of ...
2
votes
7answers
13k views

How to show available disks on a Linux system?

If i run fdisk -l I get an output as: Disk /dev/sda: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: ...
0
votes
2answers
464 views

Running (vertical?) diff on columns in a file

in our company we pull in inventory files from third parties. These files are in a fixed format, containing the 13-digit EAN (think UPC code) as well as other data. I also have a master list of EANs ...
0
votes
4answers
179 views

do… while loop in original 1978 awk?

Does the do... while loop work in the original awk? Or has it been introduced in later implementations (nawk, gawk, ...)? Can nawk be considered present on all Unix platforms today? Greets, Oliver
1
vote
5answers
2k views

bash script - print from line N to EOF

I want to be able to print the number of lines from bash as such: Line number (as counted from the top) -> end of the file It seems tail will only count lines from the bottom. Does anyone know how ...
1
vote
3answers
2k views

using awk in a bash script with if

I'm doing a script in which I need to test a string and based on its result I'll decide if I go further or not. The command below works fine (if the string starts with "Clean" it will print 1, ...
47
votes
12answers
62k views

Do you have any useful awk and grep scripts for parsing apache logs? [closed]

I can use log analyzers, but often I need to parse recent web logs to see what's happening at the moment. I sometimes do things like to figure out top 10 ips that request a certain file cat foo.log ...