How can I list in alphabetical order all users and also for the first 10 users to see user ID info (column 5).
I know for the first part of the question that I can use like cat /etc/passwd | cut -d ':' -f1, but how about the second part? should i use "for" or "if" or something like this?
Remove the header with grep and use cut:
cat /etc/passwd | grep -v '^#' | cut -d: -f1,5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With