.cshrc

Anyone want to share any of their .cshrc aliases?

Here are a couple of mine:-


Code:
alias fp        fping -ag 192.168.1.0/24                                                                                                                                                           
alias pi        ping -c3 8.8.8.8                                                                                                                                                                   
alias pr        ping -c3 192.168.1.1
 
I only have a couple that I define, I typically prefer long-hand, but:
Code:
alias h    'history 25'
alias ls    '/bin/ls --color=never -hF'  (I hate colorized output and I like the human readable and slashes on dirs)
alias emacs    '/usr/local/bin/emacs \!*&'   (so I don't forget to put the editor in the background when running in X)
 
I use bash on all machines (and for all accounts), so the syntax is a little different, but the principle is the same. Below, you will see some #IFDEF statements. That's because the code below is cut and pasted from the source code of my .bashrc; I use the same source code on all machines, and then have an install script that filters it in a machine-dependent fashion. Also, for some commands I don't use aliases, but functions; the example below is mkdircd, which creates a directory and then immediately cd's into it.
Code:
alias ls='ls -F'
alias la='ls -aF'
alias ll='ls -lF'
alias rm='rm -i'
alias mv='mv -i'
alias cp='cp -i'

#IFDEF Darwin
alias e='emacs -nw'
#ELSE
alias e='emacs'
#ENDIF
alias em='fg %emacs'

alias m="more"
alias etodo='emacs ~/ToDo.txt'
#IFNDEF Root  
alias poweroff='doas /sbin/poweroff'
alias reboot='doas /sbin/reboot'
#ENDIF

myisp=user@host.net
alias toisp='ssh $myisp                                                                                                                      
alias toext='ssh -p 12345 ralph@secret.hosted.machine'                                                                              
alias totunnel='ssh -p 54321 ralph@secret.tunnel.to.home'                                                                          
alias tohome='ssh ralph@home.example.com'
alias topi='ssh plumber@bench-raspberry.example.com'                                                                             alias topumpstation='ssh plumber@pumpstation.example.com'
alias togenerator='ssh plumber@generator.example.com'   

#IFDEF house
alias tooffice='ssh ralph@office.example.com'
#ELSE
alias tooffice='echo You can only reach office from house.'
#ENDIF

function mkdircd () {
        if [ $# -ne 1 ] ; then
            echo "Usage: mkdircd <dir>"
            echo "       Create a directory and cd into it"
            return ; fi

        mkdir -p $1 || return
        cd $1
}
 
Back
Top