Useful .cshrc Commands

Throughout the years of using the command line in both Linux and Mac, I have spent quite a bit of time modifying my .cshrc file to my liking.

This is mainly just a list of some commands that I think are useful.

# Prompt - Displayed as “@:
set prompt="`whoami`@%B`hostname -s`%B:" #Custom Prompt settings

alias lsl 'ls -larth'
alias qstatme 'qstat -u mturner'
alias qsubm 'qsub -I -V -l walltime=08:00:00,nodes=1:ppn=24'
alias quota '/usr/bin/quota -s -u mturner'

The “lsl” alias should be self explanatory.
“qstatme” displays the current PBS queue for my username only.
“qsubm” will start an interactive PBS job, using 1 full node, and requesting 8 hours.
“quota” will display my quota

# set title
alias cwdcmd 'echo -n "?33]0;$cwd?07"'

“cwdcmd” will change the title of the terminal window to match the current working directory


# ignore files for autocompletion
set fignore=(.o .mod)

The fignore environment variable tells the command line to ignore files that end in ‘.o’ or ‘.mod’ when doing autocompletion.

Lastly, a few lines for those of us who frequently run interactive jobs in PBS

# automatically move to directory interactive job is started from
if ($?PBS_ENVIRONMENT == 1) then
         if ( $PBS_ENVIRONMENT == PBS_INTERACTIVE ) then
                cd $PBS_O_WORKDIR
                echo 'Beginning Job     : '$PBS_JOBID
                echo 'Running on        : '$HOST
                echo 'Current Directory : '$PBS_O_WORKDIR
                echo ' '
        endif
endif


This bit of code will detect if the user has submitted an interactive job. If so, it will change the user’s directory to the directory from which the job was submitted. It will then display the job ID, the host, and the current working directory.

2 thoughts on “Useful .cshrc Commands

  1. Generally there are some interesting points in this posting however I don?t know if I totally agree with each of them, however this is okay, we will be able to agree to disagree

  2. I see a lot of interesting content on your website. You have to spend a lot of time writing, i know how to save you a lot of work, there is
    a tool that creates unique, google friendly articles in couple of seconds, just
    type in google – k2 unlimited content
    Bridgette recently posted..BridgetteMy Profile

Leave a Reply

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

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

This site uses Akismet to reduce spam. Learn how your comment data is processed.