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!
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!
Use the following command :
This command will save the output of the ps aux command into file.txt. Hope this helps...Code:ps aux >> file.txt
Use this command instead :
This will print the cpu column of ps aux command. All the best!Code:ps aux |gawk ' { print $3 }'
Bracken is correct. Use this modified command to take the cpu coulmn into a text file :
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.Code:ps aux |gawk ' { print $3 }' >> textfile.txt
Bookmarks