User Tools

Site Tools


tutorials:bash

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorials:bash [2011/02/01 02:34] chkuotutorials:bash [2012/11/23 13:59] (current) – [.bashrc (Ubuntu)] hsu
Line 4: Line 4:
 ===== Sample Configuration Files ===== ===== Sample Configuration Files =====
 ==== .bash_profile ==== ==== .bash_profile ====
-<file>+<file bash .bash_profile>
 # .bash_profile # .bash_profile
 # Get the aliases and functions # Get the aliases and functions
Line 13: Line 13:
  
 ==== .bashrc (Mac OS X) ==== ==== .bashrc (Mac OS X) ====
-<file>+<file bash .bashrc>
 # .bashrc # .bashrc
 # User specific aliases and functions # User specific aliases and functions
Line 33: Line 33:
 alias ll='ls -alFG | more' alias ll='ls -alFG | more'
 </file> </file>
 +
 +
 +# under home directory,  rename the initial .bashrc to .bashrc_v2
 +mv .bashrc .bashrc_v2
 +# create anyother .bashrc file and paste the below script into it.
 +nano .bashrc
  
 ==== .bashrc (Ubuntu) ==== ==== .bashrc (Ubuntu) ====
-<file>+<file bash .bashrc>
 # .bashrc # .bashrc
 # User specific aliases and functions # User specific aliases and functions
Line 43: Line 49:
 # User specific environment and startup programs # User specific environment and startup programs
 export PATH="${PATH}:/usr/local/bin:~/bin:~/script" export PATH="${PATH}:/usr/local/bin:~/bin:~/script"
 +export PERL5LIB="${PERL5LIB}:/usr/local/bin"
  
 # enable color support of ls and also add handy aliases # enable color support of ls and also add handy aliases
Line 55: Line 62:
     alias egrep='egrep --color=auto'     alias egrep='egrep --color=auto'
 fi fi
 +
 +# some more ls aliases
 +alias l='ls -lF'
 +alias ll='ls -alF'
 +alias lm='ls -alF | more'
  
 # shell command alias # shell command alias
Line 60: Line 72:
 alias ..='cd ..' alias ..='cd ..'
 alias cd..='cd ..' alias cd..='cd ..'
-alias l='ls -lF+ 
-alias lm='ls -lF | more+# short cut  
-alias ll='ls -alF | more'+alias pls='cd ~/plscript/
 +alias sc='cd /scratch/$USER/
 + 
 +# ssh alias for connecting to other machines 
 + # Academia Sinica 
 + # hickory 
 + export HICKORY='140.109.56.179' 
 + alias hickory='ssh $HICKORY' 
 </file> </file>
  
 ===== Shell Scripts ===== ===== Shell Scripts =====
 ==== Pack Up Directories ==== ==== Pack Up Directories ====
-<code bash>+<file bash tz>
 #!/bin/sh #!/bin/sh
 for x for x
Line 75: Line 95:
  gzip "$x.tar"  gzip "$x.tar"
 done done
-</code>+</file>
  
  
Line 88: Line 108:
 sudo vsdbutil -a /Volumes/MyDrive sudo vsdbutil -a /Volumes/MyDrive
 </code> </code>
- 
  
tutorials/bash.1296498872.txt.gz · Last modified: 2011/02/01 02:34 by chkuo