Tuesday, February 1, 2011

Bring back your productivity with symbolic links and alias

Symbolic links


Everyday you go into dozen of different working directories for work, keep typing cd xxx/xxx/xxx/ just slow you down. Use symbolic links to gather shortcuts.


ln -s [target_directory] [name_of_the_link]

For example:

ln -s ~/projects/ru05/playground/menu_web ~/menu_web

then everytime you want to go somewhere, just execute

cd ~/menu_web

one shot, no pain
it's cool


Alias

I was working in a company which only gave development team a tiny harddisk space for UAT, and there were many applications deployed by different teams. Obviously, not everyone cares about housekeeping their own shit. So I frequently had to check the disk space ...

many people knows about du -sk to check spaced used, but I also want to sort the result. here comes the long command:

du -skc * | sort -rn

To keep my hands and finger healthy, I created alias to type less:

alias dusk='du -skc * | sort -rn'

Better save some time doing other meaningful stuff instead of repeatedly typing mundane commands.

No comments:

Post a Comment