Find the answer to your Linux question:
Results 1 to 3 of 3
Hello fellow Linux users, this is my first post here and I'm happy to be a part of these forums. I have a few very specific questions that I would ...
  1. #1
    Just Joined!
    Join Date
    Mar 2010
    Posts
    2

    ps and nice questions (Process priority)

    Hello fellow Linux users,
    this is my first post here and I'm happy to be a part of these forums.
    I have a few very specific questions that I would like help with if anyone could try and give me a hand.

    I am currently using the ps command with options "ps -eo pri, ni, cmd", I would like however to display the output form the highest to lowest priority. I can not however figure out how to do this, I have searched all over the place!

    Another question, say for example I have a process and I would like to decrease the priority of that process by 10 (without knowing the original priority). Can this be done?

    Thank you very much, any help is appreciated!

  2. #2
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    665
    ps -eo pri,ni,cmd | sort -n
    or
    ps -eo pri,ni,cmd | sort -nr

    will sort, or sort and display in reverse, the output, you may need to make it

    ps -eo ni,pri,cmd | sort -nk 2 (or sort -nrk 2)
    to sort using the 'ni' field (the 2nd colomn).


    as for changing the niceness of a process, you can use renice as root. I have no idea what priority is, so I can't help you there.
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  3. #3
    Just Joined!
    Join Date
    Mar 2010
    Posts
    2
    Thank you!

Posting Permissions

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