Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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.


  2. #2
    Linux User cyberinstru's Avatar
    Join Date
    Jan 2007
    Try this...

    [QUOTE][cat /etc/passwd | sort -r | cat -n > sample.txt/QUOTE]
    Registered Linux User #440311

  3. #3
    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

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts