easily extract a column of data from multiple columns
October 2nd, 2006 mysurface Posted in cut, Misc, pipeline, Text Manipulation, xargs | Hits: 77784 | 3 Comments »
To extract a column of data from multiple column, we can use cut. Usually cut use to extract value from huge trace file or data file such as /etc/passwd.
To extract all available user name from /etc/passwd, you can do this
cut -d":" -f1 /etc/passwd
Cut extract value line by line, to put all into 1 line, you can use xargs
cut -d":" -f1 /etc/passwd | xargs echo







October 2nd, 2006 at 7:26 pm
Thanks! It’s very useful to extract data.
August 1st, 2007 at 2:01 am
[...] Check out command cut for usage examples. [...]
February 9th, 2011 at 11:16 am
I found your weblog web site on google and test just a few of your early posts. Continue to keep up the superb operate. I simply further up your RSS feed to my MSN News Reader. In search of forward to reading extra from you afterward!…