Shell very slow to load - Ubuntu 14.04

Opening my terminal (ctrl+alt+t), it takes a long time to load my prompt. I had read here regarding the same issue but none of their solutions helped me. On opening the terminal, it takes around 4-5 seconds to load and just before the prompt appears, I see a really quick flash of a white splash-screen sort of program popping up. I don't think that this has happened after installing any particular package/software. Any suggestions?

Thanks in advance.


Solution 1:

To see every command that runs during your shell's startup configuration, put

set -x

at the top and

set +x

at the bottom of both files ~/.profile and ~/.bashrc.

(Keep your text editor open so you can undo these changes easily!)

Then in a terminal, run:

$ bash --login

and see which command takes the most time.