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

    [BASH] Contorl Terminal. and top utility.Help,Help

    I have written a bash script and a loop to display some output within a terminal and I using
    tput cup 0 0 command to prevent the terminal scrolling(this is very important) before each complete output pattern.
    The pattern refresh time by time but there is a question.
    for example the loop produce its first pattern is:
    Linux is better than Windows!
    Linux is wonderful!
    Have a good day!
    and then the loop produce its second pattern which is(Thx you guys!):
    The terminal will become like this:
    Thx you guys!r than Windows!
    Linux is wonderful!
    Have a good day!

    How can I fix that. What I really want it's only display the newer pattern which the loop produce and all the displaying should in the same terminal which will not scrolling.

    I know there are something tput lines and tput cols
    I consider to use them in such after each $ echo get the value that tput cols minus where the cols I am and produce some blank, but this sound

    Can anyone get the script of the top utility, or What is the meaning of the some of the message produce by $ top
    Cpu(s): 7.1%us, 3.1%sy, 0.0%ni, 89.6%id,

    what's us sy ni id standfor? How can I get that.
    My understanding is that
    I can use $ ps aux to get the list.
    but which user is categorize as us sy ni id ?
    For my example I have root syslog 102 avahi 107 1000 ...... in the User cols

    Thank you so much! Have a good day!

  2. #2
    For Q1
    simply using tput ed after tput cup 0 0

    Still need help with Q2

  3. #3
    Q2.Cpu(s): 7.1%us, 3.1%sy, 0.0%ni, 89.6%id,

    US = User space
    SY = System (kernel)
    NI = nice
    ID = Idle

    have a look at 'man top'', you can use a lot of cmd to sort results.

  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