LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-04-2008, 12:23 PM   #1
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Rep: Reputation: 57
how to log ps -aux ?


Hello,

I would be looking for a script that can :
log ps -aux ?

I would like the new changes, to be logged bit like watch

Is there that not to program it?
thanks

Last edited by frenchn00b; 11-04-2008 at 02:07 PM.
 
Old 11-04-2008, 12:29 PM   #2
POW R TOC H
Member
 
Registered: Mar 2008
Location: Serbia
Distribution: Fedora
Posts: 37

Rep: Reputation: 15
How do you mean log? If you want the output of 'ps -aux' in a file, just do
Code:
ps -aux > log_name
 
Old 11-04-2008, 01:26 PM   #3
nishamathew1980
Member
 
Registered: Oct 2008
Posts: 37

Rep: Reputation: 16
ps -aux >> <file_you_want_to_store_your_logs> should do the trick.

Instead of using >> if u > the contents in the file (if any) will get overwritten.

Linux Archive

Last edited by nishamathew1980; 11-09-2008 at 04:55 AM.
 
Old 11-04-2008, 02:07 PM   #4
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by POW R TOC H View Post
How do you mean log? If you want the output of 'ps -aux' in a file, just do
Code:
ps -aux > log_name
I would like the new changes, to be logged bit like watch
 
Old 11-04-2008, 03:32 PM   #5
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
Code:
f_ps_aux()
{
   echo "**** Timestamp: $(date) ****"
   echo ""
   /bin/ps aux
}

f_ps_aux >> ps_log.$(date +%Y%b%d)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ps aux and top graziano1968 Linux - Server 1 11-30-2007 09:58 AM
one username in ps -aux not resolving FliesLikeABrick Linux - Software 1 01-17-2007 05:20 PM
problem with syntax in ps -aux alaios Linux - General 2 09-30-2006 07:34 AM
SB Live & Aux-In Volume... thugic Slackware 0 03-07-2006 09:29 AM
help me analyze the output of ps -aux slackist Linux - Newbie 5 03-28-2004 08:20 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration