Skip to content

Instantly share code, notes, and snippets.

@datlife

datlife/README.md

Last active Feb 4, 2020
Embed
What would you like to do?
UNIX Tricks

Format /etc/passwd file

tail -n +11 /etc/passwd| sort -t$':' -k3 -n | awk -F":" \
'
 BEGIN {
    printf "GID | Name        | User_dir          | Bash_Access        | Description      \n"
    printf "--- | ----------- | ----------------- | ------------------ | -----------------\n"
 }
 {
    printf "%s | %s | %s | %s | %s\n",$3, $1, $6, $7, $5 
 }' |\
 column -t -s "|"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment