he I have simple script.
ps -efo 'stime user pid pcpu rss pmem comm'
How to add first colum as date from date command and have column header date.
Thanks
Matt
Please note that there are differences between [tt]ps[/tt] implementations for different operating systems. Just because your [tt]ps[/tt] does not understands it, does not mean that is invalid. My [tt]ps[/tt] on Linux executes it correctly.
Matt, please specify on what system you run that command.
I do not really understand what you need, but I hope this is close to that.
Code:
ps -efo 'stime user pid pcpu rss pmem comm' | while read d l; do test "$d" == "STIME" && echo "Date $l" || echo "`date -d $d` $l"; done
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.