This is what I have tried so far sort /etc/passwd -t: -k1 > ~/passwd.byloginI keep getting an error that the output is wrong. The question is:Sort the /etc/passwd file in alphabetically ascending order, using the user's login shell as your primary key. Store the results in the file newly created file passwd.bylogin I don't understand why I am not getting the correct output.
Why am I not getting correct output with sort command
sort
If I'm reading the question correctly, you're supposed to be sorting by the shell, which is the 7th field.  Thus, the following should work for you:sort /etc/passwd -t: -k7 > ~/passwd.bylogin