简体   繁体   中英

Cut Linux variable number of spaces

I need to get in linux the third column...

I used first last | cut -d " " -f 3 but it doesn't work and after that I taught the char is a TAB and used last | cut -f 2 and it's still not working...

how shoult i get that?

在此处输入图片说明

You might try it with awk :

<your-program-giving-tabular-output> | awk '{ print $3 }'

For example with ps :

ps | awk '{ print $3 }'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM