Showing posts with label bash functions. Show all posts
Showing posts with label bash functions. Show all posts

Friday, January 17, 2014

How to close automatically the terminal after a certain period of inactivity

0 comments

How to close automatically the terminal after a certain period of inactivity

From time to time, we execute several commands, such as commands of update,upgrade,install, and remove ... and after we close our Terminal.

This trick will close the terminal automatically for you after a period of time after being inactive.

We open the file /etc/profile with any editor you like (as root), I prefer Gedit :

sudo gedit /etc/profile

Once the file is opened, append the following lines to the end of the file :

TMOUT=seconds 
export TMOUT

How to close automatically the terminal after a certain period of inactivity

Replace seconds by any number of seconds you want. Save the file and execute this following command to apply the new changes :

source /etc/profile

 In my example I used 600, so my Terminal will be automatically closed after 600 seconds of inactivity.




     
Read more...