View Single Post
  #1   (View Single Post)  
Old 2nd May 2008
anomie's Avatar
anomie anomie is offline
Local
 
Join Date: Apr 2008
Location: Texas
Posts: 445
Default Quick, simple tcsh tips for beginners

New to tcsh? Already familiar with bash? Sure, you could easily read through the manpages for tcsh(1), but here are a few quick and easy tips to help you feel right at home.

-----------------------------------------

Enable Tab command completion
One approach (or simply edit with your favorite editor):
Code:
echo 'set autolist' >> ~/.cshrc
Colorize your ls output
Use this (or simply edit with your favorite editor):
Code:
echo 'setenv CLICOLOR' >> ~/.cshrc
Source a file in to your environment
In Bourne shells (like bash), this is accomplished using:
Code:
. file_here
In csh / tcsh shells, this is accomplished using (logically enough):
Code:
source file_here
You'll need to do that to source in your ~/.cshrc changes, so now is a good time to practice!

Jump around the command line
So, you typed a long command (but haven't hit enter yet), and now you need get back to the very beginning of the command line -- simple: use Ctrl + A.

Now you fixed that typo at the very beginning of the command line, and you want to get back to the end of it to keep typing -- simple: use Ctrl + E.

Write a script that utilizes your cool new tcsh shell
I had to tack this one on, just in case.

Use Bourne shells for scripting. Do not use csh / tcsh for scripting. The reasons are exhaustively enumerated here:

http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/

-----------------------------------------

Hopefully these tips have just made you slightly more productive within tcsh. Have fun with your new shell!
__________________
Kill your t.v.

Last edited by anomie; 2nd May 2008 at 03:48 PM.
Reply With Quote