-
Piping + redirection
I know this isnt a mandriva "thing"but im on mandriva and am not sure where else to post this. It might seem simple to you but i come from a windows backround, so its abit new to me.
anyways, here is the question. its for a linux essentials course that I am busy with to get LPI.
The password file path : /etc/passwd
Order this file to display the user name in reverse alphabetical order(z-a) and then use another command to put line numbers in front of each line. These changes are then put into a new file called passwrdformatted.txt
now Im not sure about the first part. the reverse alphabetical order , do i use sort -r, and if so how ? ...
Please gimme the full command.
the command must be ONE line long.
thanks.
-
Try this...
[QUOTE][cat /etc/passwd | sort -r | cat -n > sample.txt/QUOTE]
-
i had something similar to that, however it doesnt solve the problem of displaying the username in reverse alphabetical order :|. you have to grep "username" /etc/passwd is what i assume to be the missing part in the command, but how does it all go together :-? :???: