Quantcast
Channel: txt » Uncategorized
Viewing all articles
Browse latest Browse all 10

Fetch columns of Output using Awk

$
0
0

One can use awk to get a specific column from a command output…

First column of the command
date|awk '{print $1}'

11th Column of the command
ps aux|awk '{print $11}'

Use a different Field separator
cat /etc/passwd|awk -F ':' '{print $1}'

[tags]awk,sed,shell,script,output,filter,text,cli,linux,string,separator[/tags]


Viewing all articles
Browse latest Browse all 10

Trending Articles