Skip to content

Tag: awk

Generate a report using awk

I have /etc/fstab entries on 100 servers and i’m trying to write a awk script to identify following. What i need is, first my awk script need to print the domain name, then it should print tools incorrectly mounted on store and is not valid, but kdump01 mounted correctly on kdump , ops mounted correctly…

How can I delete a specific text in a text file

I have a text file : and I want to delete 192.168.47.1 line I tried but output is : I tried sed ‘s/192.168.47.1//g’ but again output is : I searched on google but but I am not able to find the right one. Answer The problem is that your pattern matches 3 lines in your data. You need to end

Running statistics on multiple lines in bash

I have multiple HTTP headers in one giant file, separated with one empty line. I have approximately 10,000,000 of headers separated with an empty line. If I want to discover trends, like header order, I want to do aggregate headers to a one-liner (how I can aggregate lines ending with an empty line and do tha…

Join two csv files

csvfile1 csvfile2 expected output I would like to combine the columns longitude,latitude and timestamp of both the files. There are two longitudes and two latitudes in csvfile2. So i want to compare if it matches any one of the longitude-latitude pairs along with the timestamp. And the column name order is al…