Find the answer to your Linux question:
Results 1 to 6 of 6
i want to save the output of top command so i did below top >> fileA it successfully writes the output but it overwrites the existing result. I want every ...
  1. #1
    Just Joined!
    Join Date
    Mar 2008
    Posts
    63

    top command save in a file

    i want to save the output of top command so i did below
    top >> fileA

    it successfully writes the output but it overwrites the existing result. I want every new result will save but no overwrite
    any help

    thanks

  2. #2
    Just Joined! paintba||er's Avatar
    Join Date
    Nov 2007
    Location
    Mormonville, UT
    Posts
    33
    Have you tried using it in batch mode with the -b option?

  3. #3
    Just Joined!
    Join Date
    Jun 2006
    Location
    Carlisle, MA
    Posts
    13
    How you are stopping the `top' command between runs?
    Tom

  4. #4
    Just Joined!
    Join Date
    Mar 2008
    Posts
    63
    i am new in linux. i just want to save every new result of TOP in the file

  5. #5
    Just Joined!
    Join Date
    May 2006
    Posts
    4
    Quote Originally Posted by z_haseeb View Post
    i am new in linux. i just want to save every new result of TOP in the file
    Use -b and -d option in top comamnd.
    -b is for for sending output from top to other programs or to a file and -d is for delay time.
    So for example, to save output of top command to top_output file in 2 seconds delay.
    top -b -d 2 >>top_output
    Also, use can use -n option to limit the number of iterations. Look at the man page of top for more option

  6. #6
    Just Joined!
    Join Date
    Mar 2008
    Posts
    63
    thanks. its working

Posting Permissions

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