That script -
.bash_logout - is executed by bash when login shell exits, and that code from your question intends to clear the screen to increase privacy when leaving the console.
SHLVL is a environment variable which came from "SHell LeVeL" and lets you track how many subshells deep your current shell is. In your top-level shell, the value of
$SHLV is 1. In the first subshell, it's 2; in a sub-subshell, it's 3; and so on. So SHLVL indicates how many shells deep the user is. If the level is 2, you must type
logout to exit.
"$SHLVL" = 1 i.e. if you are in the top-level shell, then...
[ -x /usr/bin/clear_console ] is another test and means something like: test if the file
/usr/bin/clear_console exists and is executable.
&& this command:
/usr/bin/clear_console -q is executed only if
[ -x /usr/bin/clear_console ] succeed with success.
And finally: what
/usr/bin/clear_console means? From
clear_console clears your console if this is possible. It looks in the
environment for the terminal type and then in the terminfo database to
figure out how to clear the screen. To clear the buffer, it then
changes the foreground virtual terminal to another terminal and then
back to the original terminal.
clear_console is very approached to
clear command which can be used in any terminal/console.