easily extract a column of data from multiple columns

October 2nd, 2006 mysurface Posted in cut, Misc, pipeline, Text Manipulation, xargs | Hits: 86512 | 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

5 Responses to “easily extract a column of data from multiple columns”

  1. Thanks! It’s very useful to extract data.

  2. [...] Check out command cut for usage examples. [...]

  3. 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!…

  4. 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

  5. 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

Leave a Reply