Results 1 to 3 of 3
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 ...
- 04-08-2007 #1Just Joined!
- Join Date
- Mar 2007
- Posts
- 2
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.
- 04-08-2007 #2
Try this...
[QUOTE][cat /etc/passwd | sort -r | cat -n > sample.txt/QUOTE]---------------------------------
Registered Linux User #440311
HI2ARUN _AT_ GMAIL _DOT_ COM
---------------------------------
- 04-08-2007 #3Just Joined!
- Join Date
- Mar 2007
- Posts
- 2
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


Reply With Quote
