LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Clear display on logout (https://www.linuxquestions.org/questions/linux-newbie-8/clear-display-on-logout-611836/)

RexCoeus 01-07-2008 03:47 PM

Clear display on logout
 
I decided to install Slackware 12 on an extra computer in an attempt to really learn a no-nonsense linux distro. So far everything is going well, but I'm having a slight problem. When I log out of an account in multiuser mode (runlevel 3), the screen does not clear when the new login prompt appears. I have a Linux security book that tells me to place a ( /usr/bin/clear ) line in the .bash_logout file, but I cannot seem to find that file. It is not in my home directory, or in the /etc/skel directory either. I know it is a hidden file, so don't think that I'm just making that mistake. Is it possible that the slackware distro has placed this file elsewhere, or that it is called by another name? Thanks for any suggestions.

Poetics 01-07-2008 04:00 PM

You can simply create the file to suit your needs -- go ahead and type the following and it'll create the file with all of the relevant details: "echo '/usr/bin/clear' > .bash_logout" -- it's that simple!

Many of the .bash files aren't created by default (this includes .bashrc, .bash_profile, et cetera), at least not by Slackware -- if they aren't needed, they aren't included (Slackware's MO for quite some time now).

Happy slacking!

Dinithion 01-07-2008 04:01 PM

If the file doesn't exist, simply create it.
put:
Code:

#!/bin/bash
/usr/bin/clear

in your ~/.bash_logout and

chmod u+x ~/.bash_logout

to make it executable :)

Poetics 01-07-2008 04:03 PM

I wasn't aware that .bash_logout was a shell script and needed to be executable...

Hmm, learn something new every day!

RexCoeus 01-07-2008 04:13 PM

great, thanks for your help everyone.

exvor 01-07-2008 04:33 PM

This may be a better way as this would work for all users on the system. This is not my work but taken from the BLFS project.

Quote:

One of the most common things which people want to do is clear the screen at each logon. The easiest way of doing that is to put a "clear" escape sequence into /etc/issue. A simple way of doing this is to issue the command clear > /etc/issue. This will insert the relevant escape code into the start of the /etc/issue file. Note that if you do this, when you edit the file, you should leave the characters (normally '^[[H^[[2J') on the first line alone.

Note that you will need to do this as root.


All times are GMT -5. The time now is 04:06 AM.