Results 1 to 4 of 4

Thread: ps aux command output of cpu column

  1. #1
    Join Date
    Jul 2009
    Posts
    46

    ps aux command output of cpu column

    I want to write the output of the ps aux commands cpu column. Is that possible? If not then how do i save any commands output in a text file? Please help, i'm a noob in linux OS. Thanks!

  2. #2
    Join Date
    May 2008
    Posts
    4,085

    Re: ps aux command output of cpu column

    Use the following command :
    Code:
    ps aux >> file.txt
    This command will save the output of the ps aux command into file.txt. Hope this helps...

  3. #3
    Join Date
    Jan 2009
    Posts
    140

    Re: ps aux command output of cpu column

    Use this command instead :
    Code:
    ps aux |gawk ' { print $3 }'
    This will print the cpu column of ps aux command. All the best!

  4. #4
    Join Date
    Jan 2009
    Posts
    1,738

    Re: ps aux command output of cpu column

    Bracken is correct. Use this modified command to take the cpu coulmn into a text file :

    Code:
    ps aux |gawk ' { print $3 }' >> textfile.txt
    This command will not print anything in the terminal, instead, will save the output in textfile.txt file. Also you can run it as many times, the contents of the text file will not be over written, it will be updated at the bottom of the file.

Similar Threads

  1. Replies: 6
    Last Post: 27-05-2011, 10:20 AM
  2. How to save output of ping command
    By Mewad in forum Windows Software
    Replies: 4
    Last Post: 04-01-2011, 11:02 AM
  3. Replies: 3
    Last Post: 09-12-2009, 01:11 PM
  4. Cleaning up DSGET group command output
    By IT2 Myers, Tyler in forum Active Directory
    Replies: 5
    Last Post: 14-10-2009, 06:26 AM
  5. mysql update column with another column
    By Gunter in forum Software Development
    Replies: 3
    Last Post: 23-05-2009, 09:44 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,469,180.73175 seconds with 17 queries