I am following the following details from another question on this site
You can add an alias to the command by editing the file
.profile
in your home directory:gedit $HOME/.profile
and adding the following line:
alias lock='gnome-screensaver-command -l'
Then from terminal:
source .profile
This 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?