English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Linux cut command is used to display the first num1 to num2 text.
cut [-bn] [file] cut [-c] [file] cut [-[df] [file]
Usage Instructions:
The cut command cuts bytes, characters, and fields from each line of the file and writes these bytes, characters, and fields to standard output.
If the File parameter is not specified, the cut command will read from standard input. It must specify -b,-c or -f flag one of them.
parameter:
When you execute the who command, it will output content similar to the following:
$ who rocrocket :0 2009-01-08 11:07 rocrocket pts/0 2009-01-08 11:23 (:0.0) rocrocket pts/1 2009-01-08 14:15 (:0.0)
If we want to extract the3bytes, like this:
$ who|cut -b 3 c c