I am using awk to put server login’s in a new file. I only need the first 10 login’s along with fields 1, 5, 6 of a past user. This is the awk command I am issuing but I am getting the entire server login stats of everyone placed in the new file I have created. Note the name “mark” is the example last name of the person I want to check:
awk -F: '(NR > 1 && NR < 11) {print $1, $5, $6}' last mark > name_list
Try this (I hope I understand your needs & that your
lastcommand output the same as mine) :And if you’d like to create a new file for any users :