My .tcshrc Aliases
Posted May 11th, 2003 @ 12:28am by Erik J. Barzeski
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://dict.org/d:\!*' | 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 cd
ing 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.
Posted 11 May 2003 at 1:00am #
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).
Posted 11 May 2003 at 3:01am #
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...
Posted 11 May 2003 at 5:42am #
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.
Posted 11 May 2003 at 7:56am #
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.
Posted 11 May 2003 at 9:04am #
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?
Posted 11 May 2003 at 10:27am #
Miscellanea
More tcsh goodness courtesy of Erik. Adds in nicely with this list of tweaks for your .tcshrc in an...
Posted 11 May 2003 at 11:25am #
Here are some of mine:
alias myip 'curl -s http://checkip.dyndns.org | 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'
Posted 11 May 2003 at 8:59pm #
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/:'
😀
Posted 11 May 2003 at 10:07pm #
I have:
alias unas 'otool -tV \!* | c++filt | more'
alias pbopen 'open -a /Developer/Applications/Project\ Builder.app \!*'
Posted 11 May 2003 at 10:14pm #
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)
Posted 12 May 2003 at 6:39am #
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'
Posted 12 May 2003 at 12:13pm #
you are all dorks, and I love it...although we all know you aspire to use bash.
Posted 13 May 2003 at 10:55am #
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
Posted 18 May 2003 at 7:54pm #
Shell
There’s some discussion on Erik Barzeski’s blog about shell aliases and tricks.
Posted 21 May 2003 at 5:25pm #
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.