I am following the following details from another question on this site
You can add an alias to the command by editing the file
.profilein your home directory:gedit $HOME/.profileand adding the following line:
alias lock='gnome-screensaver-command -l'Then from terminal:
source .profileThis will activate the alias. From now on, the alias lock In a terminal will have the effect of locking the screen.
But I have to hit source .profile every time I open a new terminal. I want to make this permanent. What should I do?