Guest User

Untitled

a guest
Jan 17th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. # cd to parent directory of the file (even if it is symbolic link)
  2. function pd() {
  3. local dir=`realpath ${1:-.}`
  4. cd $dir(:A:h)
  5. }
  6.  
  7. # alias -g ...=../../, ....=../../../, .....=../../../../, ......
  8. eval `ruby -e "(2..20).each{|i| puts 'alias -g .'+'.'*i+'='+'../'*i}"`
Add Comment
Please, Sign In to add comment