-5

I found this line

cut -d: -f1 /etc/passwd

as the first command used by root on my server. I think it looks like someone wanted to disable the user accounts somehow, but I'm having trouble making everything else work now. Does anyone know what it does?

1
  • I'm voting to close this question as off-topic because man pages are on your system for a reason. Use them before asking for help here, please.
    – EEAA
    Dec 6, 2015 at 20:12

2 Answers 2

5

That command outputs a list of usernames on the system.

cut is a command used to process text according to columns. -d: tells the command that columns are delimited by the : character. -f1 tells the command to display only the first field. /etc/passwd is the file it is to read data from.

The /etc/passwd file contains a line for each user. Each line has columns separated by : the first of which is the username.

It will only display accounts defined locally on the machine. If the machine is configured to retrieve account information from a network service, there may be more accounts than those you can find in /etc/passwd.

2

man cut

-d: set : as the field delimiter
-f1 select field number 1

Selects the first field of /etc/passwd in other words print a list with user names...

1
  • 2
    There you go RMAAS
    – user9517
    Dec 6, 2015 at 19:48

Not the answer you're looking for? Browse other questions tagged .