Live Chat!

easily extract a column of data from multiple columns

          0 votos

October 2nd, 2006 mysurface Posted in Misc, Text Manipulation, cut, pipeline, xargs | Hits: 14580 |

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

2 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. [...]

Leave a Reply