Profile

Cover photo
Leo G
Worked at Techarena51.com
Lives in Mumbai
169 followers|222,821 views
AboutPostsPhotosYouTube

Stream

Leo G

Shared publicly  - 
 
Last week I was reading up on #awk and its incredible text processing capabilities.

I mostly use awk for printing out columns while searching for the number of connections from an IP address.

netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
But while searching for a solution to a comment on my last post, I learnt that awk has some pretty neat tricks up its sleeves when it comes to text processing.

Let’s take a simple example of awk on the following “/etc/passwd” file.

leog:x:502:502::/home/leog:/bin/bash
leo:x:506:506::/home/leo:/bin/bash
awk:x:911:911::/home/awk:/sbin/nologin
This file has fields separated by colons.

If I wanted to print only the GID and UID columns using awk then I would do http://techarena51.com/index.php/advance-text-processing-examples-awk/ #bash   #linuxtutorial   #programmingtutorial  
1
Add a comment...
1
Add a comment...

Leo G

Shared publicly  - 
 
Docker benchmarking
 
Serial boot of 15 Docker containers
1
Add a comment...
People
Have him in circles
169 people
Rizwan Iqbal's profile photo
Saurabh Pande's profile photo
Pratik Gill's profile photo
Sandip Dalvi's profile photo
prince gonsalves's profile photo
Deepna Uchil's profile photo
Prashant Gonga's profile photo
Vaibahv Kulkarni's profile photo
Work
Occupation
Lead system operations and development (Devops)
Skills
Shell Scripting, Ruby programing, Linux System administration, Project management, Product management, team leadership
Employment
  • Techarena51.com
    Manager
Basic Information
Gender
Male
Story
Tagline
Regular guy who loves opensource technology
Bragging rights
Completed Electronics Engineering
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Mumbai
Links
YouTube
Contributor to
Links