LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 07-30-2004, 09:39 AM   #1
koyi
Member
 
Registered: Jul 2003
Location: Osaka, Japan
Distribution: Arch, Ubuntu
Posts: 421

Rep: Reputation: 31
Clearing the tty console screen on logout


Hello, guys. I am just wondering if there is a way to clean the screen when u log out from the console(where you get to by pressing ALT+CTRL+F?)?

For example, when I log into from the console, do some work and edit some files there, after I logged out, the stuff I worked on is still showed on the screen. And that make other ppl easily find out what was I doing... (Although I am not doing anything strange... what can u expect from a console... :P)

So, any idea?

Thanks in advance
 
Old 07-30-2004, 09:57 AM   #2
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,684

Rep: Reputation: 54
I have the following in the file ~/.bash_logout:


# ~/.bash_logout: executed by bash(1) when login shell exits.

# when leaving the console clear the screen to increase privacy

case "`tty`" in
/dev/tty[0-9]) clear
esac


but there are other ways to do it, too

pressing STRG+L or (CTRL+L) for instance...

pressing ALT+CTRL+F does nothing - at my machine, that is...
 
Old 07-30-2004, 10:03 AM   #3
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,684

Rep: Reputation: 54
oops - I misunderstood you here - because I use always ALT+Right-Arrow / ALT+Left-Arrow to change consoles
 
Old 07-30-2004, 10:22 AM   #4
koyi
Member
 
Registered: Jul 2003
Location: Osaka, Japan
Distribution: Arch, Ubuntu
Posts: 421

Original Poster
Rep: Reputation: 31
It is ok... I should hav put it like "ALT+CTRL+F[1-9]" maybe?

but the script doesnt work here...
I am using Gentoo, with a bash shell.... that means it should work doesnt it? weird....
 
Old 07-30-2004, 10:26 AM   #5
koyi
Member
 
Registered: Jul 2003
Location: Osaka, Japan
Distribution: Arch, Ubuntu
Posts: 421

Original Poster
Rep: Reputation: 31
Oh I found the problem... Gentoo names consoles as /dev/vc/[0-7]...

Thanks!
 
Old 07-30-2004, 10:58 AM   #6
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,684

Rep: Reputation: 54
You have devfs - the standard in Gentoo - at least it was that way.
Thats why (not only these) names are different.
I used that too, but decided to switch back to "normal" and see what sysfs and udev might bring...
 
Old 07-30-2004, 11:06 AM   #7
koyi
Member
 
Registered: Jul 2003
Location: Osaka, Japan
Distribution: Arch, Ubuntu
Posts: 421

Original Poster
Rep: Reputation: 31
devfs... I heard of this term before but dun actually understand what does it mean... and how does it differ from the traditional approach on handling devices..... coz I dun even know about the traditional ways.... I think I should grab a book on that later after I finish my exams next month

Thanks.
 
Old 07-30-2004, 11:25 AM   #8
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,684

Rep: Reputation: 54
devfs is about dynamically assigning device-nodes (or device-files ?) to avoid having hundreds of device-nodes under /dev that you actually never use - there are more than 150 entries for harddiscs for example (/dev/hd?).
Linux is not a System primarily for desktops, where one usually has one harddisc and a CD-Rom-drive and few people are having 4 or even more ide-drives - but still these entries are present.
With devfs you just have device nodes for the hardware that is actually connected to your system and they get added dynamically, as they are present. That is more or less it (very roughly).

Good luck -if it is a matter of luck :-; for you and your exams!
 
Old 07-30-2004, 11:32 AM   #9
koyi
Member
 
Registered: Jul 2003
Location: Osaka, Japan
Distribution: Arch, Ubuntu
Posts: 421

Original Poster
Rep: Reputation: 31
Thanks for your explanation
That saved me a lot of time looking up

Enjoy life!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
more then 12 tty /console ... apenguinlinux Debian 4 02-21-2005 09:56 PM
Redirecting console boot messages to different tty. cenkozkan Linux - Software 2 01-17-2004 04:11 AM
Clearing the screen in C++ qcoder Programming 7 11-29-2003 11:03 AM
Clearing the Ms Dos screen in java? Ginger1329 Programming 3 11-13-2003 09:40 PM
Clearing screen xunilpassion Programming 1 10-16-2003 03:54 PM


All times are GMT -5. The time now is 06:33 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration