Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
tyingq
on Sept 30, 2021
|
parent
|
context
|
favorite
| on:
Understanding Awk
For some idea, a one liner to find the (last) longest username and length in /etc/passwd:
$ awk -F: '{len=length($1);if(len>max){max=len;user=$1}}END{print user,max}' /etc/passwd
flandish
on Sept 30, 2021
[–]
Thanks for that reply! It's good to work with an example.
Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: