Ubuntu – list all local/system users
$ cut -d: -f1 /etc/passwd
cut OPTION... [FILE]... – print selected parts of lines from each
FILE to standard output. With no
FILE, or when
-, read standard input. Arguments:
-d, --delimiter=DELIM– use
TABfor field delimiter. In our case the delimiter is
-f, --fields=LIST– select only these fields; also print any line that contains no delimiter character, unless the
-soption is specified. In our case the field list contains only one field,
1, meaning that the
cutcommand will print the first field resulted after splitting the line by the delimiter. If we need more fields printed we just list them all separated by comma e.g.
cut -d: -f1,5,6 /etc/passwd.