1.linux shell startup files
From http://mmahmoodict.wikidot.com/blog:linux-startup-files
When an interactive login shell starts, it executes series of pre-defined startup files. Thelogin shell executes commands in following order.
- /etc/profile (applicable to all users)
- ~/.bash_profile
- ~/.bash_login
- ~/.profile,
but, by default there are only /etc/profile and ~/.profile in ubuntu13.04.
After that, any interactive non-login shell also executes commands in /etc/bashrc (applicable to all users) and ~/.bashrc. These files are not perfect for set PATH (specially, PATH=$PATH:.), since it may run multiple times.
$PATH typically set and exported in /etc/profile
During login, the system sets environment variables from the /etc/environment file before reading your login profile (.profile).
vi /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
2.八数码问题
http://blog.csdn.net/luxiaoxun/article/details/7629331