r҉ustic cy͠be̸rpu̵nk🤠🤖 is a user on mastodon.social. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.
r҉ustic cy͠be̸rpu̵nk🤠🤖 @cypnk

I keep forgetting this:
If you're coming across an old *nix box that you haven't used in a while and want to bring up all the users on the system, run this command:

awk -F':' '{ print $1}' /etc/passwd

Almost all *nix systems have awk available and /etc/passwd is the account login file (passwords themselves are usually stored /etc/shadow)

You can also just make yourself a shell script:

#!/bin/sh

awk -F':' '{ print $1}' /etc/passwd

exit
# End script

· Web · 3 · 4

@cypnk
Why use awk when the cut command can do the same thing with less overhead and is just as available?

cut -d ':' -f 1 /etc/passwd

@ND3JR Just used to it, I suppose ;)

This was part of an older script I used as a bash blogging engine

@ND3JR actually it can be golfed even more: cut -d: -f1 /etc/pas* 😆