cut

remove sections from each line of files

To find out the users that are currently logged in
copy
11
1
who | cut -d" " -f1To find out the users that are currently logged in

details |

Result:

root
user1
user1
user2

Options:

  • cut -f, cut --fields
    -f, --fields=LIST select only these fields; also print any line that contains no delimiter character, unless
  • cut -d, cut --delimiter
    -d, --delimiter=DELIM use DELIM instead of TAB for field delimiter