Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
So far all of our configurations for our Unix working environment have been done in either the .bash_profile configuration file, or in .bashrc and that's typically the two places that you'll locate them, because those are the files that get read in when you first start a new session and they set things up the way you like. But there is one other configuration file that I don't want us to forget about, which is the logout file. That's in bash_logout, and anything that's in there will get executed whenever we log out of Unix. Let's take a look at how it works. Let's create a new file. You see I don't have a bash_logout file right now, So let's do nano .bash_logout and in it let's just put echo "See ya later!", which is nice and simple.
That's the command that we get run whenever we log out. Now on a Mac, let me just show you first of all that there is the file .bash_logout. Now on a Mac, it's not that useful because if we close this window, if we just go up here and close it, well then we'll never see that echo statement. If we do it this way, exit, then you see it run, "See ya later!" Now you may be thinking, "Well, if I normally just close the window, why have this file at all?" Well, immediately you won't use it very much, but I just want you to know that that's there. You could use it. It could alert you if there's some unfinished business before you log out.
It could start a database backup as soon as you logout. It could notify friends who are on the same server that you've left the server. It could record some things in a log file or maybe clear out some temporary files that you left behind. All of those types of things could be put into a bash_logout file and even though you aren't seeing them, you certainly won't see anything that's echoed, it does get executed. So for example, if you had a clearing out some temporary files, Unix would gracefully close out, run everything in the bash_logout file as the window was closing.
So again, it's certainly the least useful of the configuration files, but it's still important not to forget that it's there.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.