easily extract a column of data from multiple columns
October 2nd, 2006 mysurface Posted in cut, Misc, pipeline, Text Manipulation, xargs | Hits: 117191 | 5 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!…
July 3rd, 2014 at 5:26 pm
I see a lot of interesting content on your website.
You have to spend a lot of time writing, i know how to save you a lot of time, there is a tool that creates unique, SEO friendly articles in couple
of minutes, just type in google – laranita’s free content source
August 27th, 2014 at 7:48 pm
I read a lot of interesting articles here.
Probably you spend a lot of time writing,
i know how to save you a lot of time, there is an online tool that creates
readable, SEO friendly articles in seconds, just type in google – laranitas free content source