Better PS aliases

export PSOA='user,pid,time,state,command' ; function _ps { /bin/ps $@ ; } ; alias psa='_ps ax -o $PSOA'
#ps aliases PSO='user,pid,ppid,%cpu,%mem,time,start,state,command' PSOA='user,pid,time,state,command' PSOL='user,pid,ppid,%cpu,%mem,nice,pri,etime,time,tt,state,ucomm' export PSO PSOA PSOL function _ps { /bin/ps $@ ; } alias ps='_ps ax -o $PSO' alias psa='_ps ax -o $PSOA' alias psl='_ps ax -o $PSOL' alias psm='_ps -U $USER -o $PSOA'

2010-05-27 02:07:56

These Might Interest You

  • When setting up a new aliases file, or having creating a new file.. About every time after editing an aliases file, I source it. This alias makes editing alias a bit easier and they are useful right away. Note if the source failed, it will not echo "aliases sourced". Sub in vi for your favorite editor, or alter for ksh, sh, etc.

    alias va='vi ~/.aliases; source ~/.aliases && echo "aliases sourced"'
    greggster · 2011-03-10 06:41:37 1
  • these are some aliases you can use in bashrc to shorten the amount of typing needed to use apt-get, also can be used as reference if you can't remember alot of commands or command parameter variations,etc... Please comment with more apt-get aliases if I missed any, thx Show Sample Output

    alias agi="sudo apt-get install" #package_names
    professoralex · 2009-05-14 03:31:47 0
  • The example command deletes all aliases for network interface 'em0' assuming that the aliases have netmask of and the master IP has some other netmask (such as See here -> for more on the rationale of this command.

    ifconfig | grep "0xffffffff" | awk '{ print $2 }' | xargs -n 1 ifconfig em0 delete
    vwal · 2009-08-04 05:18:36 0
  • I wrote this a long time ago, wondering why this wasn't floating around somewhere out there (at least not where I could find).. this seems much more simple than multiple aliases and can cd out of directories easier. Show Sample Output

    up() { local x='';for i in $(seq ${1:-1});do x="$x../"; done;cd $x; }
    evil · 2012-05-16 04:21:41 1

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: