Subscribe to
NSLog(); Header Image

My .tcshrc Aliases

My recent Perly Gates entry made mention of a tcsh alias that I use: lsf. I thought I'd share - with commentary - some of my other favorite tcsh shortcuts (aliases). If you're using Mac OS X, pop these into ~/.tcshrc if you'd like.

I never use joe, but if I did, I guess I would follow its recommendation and do this:

alias joe        'joe -help \!:1'

These two usually go hand in hand:

alias psf             'ps -auxww | grep \!:1 | grep -v grep'
alias diebitch        'kill -9 \!:1'

These help me be really, really, really lazy:

alias c        'clear'
alias et       'exit'

Some file listing/counting aliases:

alias lis        'ls -laF'
alias lsf        'ls -laF | grep "\!:1"'
alias ff         'find . -name "*\!:1*"'
alias fc         'find . -name "*\!:1*" | wc -l'

Because curl is oftentimes faster than downloading in a browser (browsers are more likely to crash, too):

alias download        'cd ~/Documents/Downloads;curl \!:1 -O'
alias cbdownload      'cd ~/Documents/Downloads;curl `pbpaste` -O;exit'

Sometimes it's good to have information at your fingertips:

alias dict  "curl -s 'dict://\!*' | egrep -v '^220.*|^250.*|^150.*|^221.*'"

When troubleshooting MailDrop, this one came in handy!

alias tfmd            'sudo tcpflow -pci en0 port 25'

I've got a lot of aliases set up for quickly cding to proper directories, like the database directory for my current project "PulpFiction":

alias cdip        'cd ~/Documents/Stuff/Important/'
alias cddb        'cd ~/Library/Application\ Support/PulpFiction/'
alias cdl         'cd ~/Library/Application\ Support/Adium/Users/iacas/Logs/'

Ahhh, more lazy scripts!

alias tgz        'tar -czf \!:1 \!:2'
alias untgz      'tar -xzvf \!:1'

And so there you have it. These I take nearly everywhere I go. They're on a public site so I can quickly get at and install them wherever I may be.

15 Responses to "My .tcshrc Aliases"

  1. Most of my aliases are for servers I ssh into. I have a couple of different ones for ls as well as a couple of ones for ps (one very similar to psf).

  2. tcsh Aliases

    NSLog();: “I thought I'd share - with commentary - some of my other favorite tcsh shortcuts (aliases).”

    Here's some of mine, some simple, some easy, some f...

  3. I would recommend installing the "dict" program in place of that dict alias.

    Also, I would suggest that anyone using tcsh regularly investigate its programable completion options. I think being able to tab complete remote filenames with scp is pretty much one of the raddest things, ever.

  4. Vinay, I use ~/Library/Application Support/Terminal/ and a bunch of .term files for all of my SSH commands. Then I launch them with Terminal Pal.

    Benjy, yes, I use tcsh's auto-completion regularly. But those aren't aliases.

  5. Benjy,

    I have a bunch of autocompletion thingies that I've liberated from Fred's examples. But how do you do completion of remote filenames with scp?

  6. Miscellanea

    More tcsh goodness courtesy of Erik. Adds in nicely with this list of tweaks for your .tcshrc in an...

  7. Here are some of mine:

    alias myip 'curl -s | grep "IP Address"'

    alias redo 'sudo \!-1'

    alias hex 'echo "ibase=16;" `echo \!* |tr "[:lower:]" "[:upper:]"` |bc'

    alias decimal 'echo "obase=16; \!*" |bc'

    alias isrunning 'ps ax | grep \!* | grep -v grep'

  8. Completion of remote filenames with scp? Easy! Like this:

    complete scp 'c%*@*:%`set q=$:-0;set q="$q:s/@/ /";set q="$q:s/:/ /";set q=($q " ");rsh $q[2] -l $q[1] ls -dp $q[3]\*`%' 'c%*:%`set q=$:-0;set q="$q:s/:/ /";set q=($q " ");rsh $q[1] ls -dp $q[2]\*`%' 'c%*@%$hosts%:' 'C@[./$~]*@f@' 'n/*/$hosts/:'


  9. I have:

    alias unas 'otool -tV \!* | c++filt | more'

    alias pbopen 'open -a /Developer/Applications/Project\ \!*'

  10. I should also add:

    alias netspy 'sudo tcpdump -i en1 not port osu-nms and not port ipp'

    (osu-nms is the Airport base station monitoring, ipp is CUPS discovery)

  11. The following opens a bbedit window with a sorted summary of the disk usage (in kilobytes) of the subdirectories referenced from the current directory:

    alias dus='du -k | sort -rn | bbedit'

  12. you are all dorks, and I love it...although we all know you aspire to use bash.

  13. tcsh shell aliases

    i just wanted to link to these entries so i have them archived and so i remember to get around to it when i'm on my iBook... T.H.E.M.'s aliasesErik from NSLog's aliases

  14. Shell

    There’s some discussion on Erik Barzeski’s blog about shell aliases and tricks.

  15. Shell Aliases

    There's a discussion going on at NSLog(); containing tips about shell aliases. I keep going back, so I thought I'd add it to my blog.