Creating a ps alias in terminal on OS X

ShareShare on FacebookTweet about this on TwitterPin on PinterestShare on Google+Share on Reddit

I remember ps -aux from my BSDi Unix days, but I wanted to expirement a little with it in terminal on OS X.  I found a good version of it for OS X that gives me most of the useful information I need:

ps -axO user,pid,%cpu,%mem,vsz,rss,tt,state,start,time,command

So…how to alias in OS X…

aliases usually live in your .bashrc file in the form of:
alias psa="ps -axO user,pid,%cpu,%mem,vsz,rss,tt,state,start,time,command"
That would alias the command string above to a command psa

But, evidently when you open a bash shell in OS X it doesn’t load .bashrc by default.

So, you need to add "source ~/.bashrc" to your .bash_login (which also doesn’t exist by default)

Clear?

This entry was posted in technology. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *