LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-05-2015, 09:51 PM   #1
sabsac
LQ Newbie
 
Registered: Sep 2015
Posts: 7

Rep: Reputation: Disabled
clear command


When I type Clear command in linux mate terminal it does not clear the screen of the previously typed commands and executed files but only moves the prompt down a few places and the screen appears to be clear.I expect the screen to be cleared completely.kindly guide.A screenshot has been attached with this question How tto send a attachment with this question?
 
Old 10-05-2015, 10:46 PM   #2
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware
Posts: 7,098
Blog Entries: 9

Rep: Reputation: Disabled
Hi & Welcome to Linux Questions.

Open your terminal and type:

Code:
history -c
and hit Enter-
 
Old 10-05-2015, 10:50 PM   #3
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware
Posts: 7,098
Blog Entries: 9

Rep: Reputation: Disabled
To send an attachment click manage attachments under "Additional Options" that's under the white box where you type you messages for your posts.
 
Old 10-06-2015, 01:41 AM   #4
vincix
Member
 
Registered: Feb 2011
Distribution: Centos 6.7, 7
Posts: 587

Rep: Reputation: 52
This is actually normal behaviour. The whole point of the 'clear' command is for you not to see any other information that could distract your attention. What difference does it make if the text is up there as long as you don't see it? It's the same in Mac OS for instance. Don't see anything wrong with it as long as it's doing its job perfectly.
 
Old 10-06-2015, 06:49 AM   #5
sabsac
LQ Newbie
 
Registered: Sep 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
attachment

Please see screenshot attached.
Attached Thumbnails
Click image for larger version

Name:	Screenshot.png
Views:	22
Size:	83.1 KB
ID:	19746  
 
Old 10-06-2015, 07:14 AM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,636
Blog Entries: 10

Rep: Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680
You want to type just "clear", not "clear screen"
Code:
$ clear
$
The result will clear it all and just have a prompt up at the top line.
 
Old 10-06-2015, 07:15 AM   #7
Fred-1.2.13
Member
 
Registered: Jan 2006
Location: Midwest USA
Distribution: Started with Slackware - 3.0 1995 Kernel 1.2.13 - Now Slackware 14.2 RC 2. Also some FreeBSD.
Posts: 116

Rep: Reputation: 52
The command is: clear

NOT clear screen.

EDIT: rtmistler beat me to it! :-)

Last edited by Fred-1.2.13; 10-06-2015 at 07:16 AM.
 
Old 10-06-2015, 07:26 AM   #8
sabsac
LQ Newbie
 
Registered: Sep 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
clear

Please see attachment.It makes no difference.
Attached Thumbnails
Click image for larger version

Name:	Screenshot-1.png
Views:	17
Size:	34.0 KB
ID:	19747  
 
Old 10-06-2015, 07:34 AM   #9
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 730

Rep: Reputation: 145Reputation: 145
I will check this out too, but if memory serves correct and you use terminal emulators from gui, you can still use handle bars to scroll up. This allows you to see previous stout.

Why it is an issue that the stuff is still scrollable, I don't know. Even in terminal emulators it will have the prompt on first line, thus appearance of a clear screen.

If that is not wanted and you are in gui, start a new session and all will be gone.
 
Old 10-06-2015, 08:48 AM   #10
mddnix
Member
 
Registered: Mar 2013
Distribution: Redhat, Ubuntu
Posts: 521

Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by sabsac View Post
When I type Clear command in linux mate terminal it does not clear the screen of the previously typed commands and executed files but only moves the prompt down a few places and the screen appears to be clear.I expect the screen to be cleared completely.kindly guide.A screenshot has been attached with this question How tto send a attachment with this question?
How about reset

Code:
$ reset
 
Old 10-06-2015, 10:04 AM   #11
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,184

Rep: Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584
If your terminal is completely hosed, and you want to use 'reset' remember to use line-feeds like this:
Code:
<ctrl-j>reset<ctrl-j>
This is explained on the man page:

Quote:
DESCRIPTION
Tset initializes terminals. Tset first determines the type of terminal that you are using. This determination is done as fol‐
lows, using the first terminal type found.

1. The terminal argument specified on the command line.

2. The value of the TERM environmental variable.

3. (BSD systems only.) The terminal type associated with the standard error output device in the /etc/ttys file. (On System-V-
like UNIXes and systems using that convention, getty does this job by setting TERM according to the type passed to it by
/etc/inittab.)

4. The default terminal type, “unknown”.

If the terminal type was not specified on the command-line, the -m option mappings are then applied (see the section TERMINAL
TYPE MAPPING for more information). Then, if the terminal type begins with a question mark (“?”), the user is prompted for
confirmation of the terminal type. An empty response confirms the type, or, another type can be entered to specify a new type.
Once the terminal type has been determined, the terminfo entry for the terminal is retrieved. If no terminfo entry is found
for the type, the user is prompted for another terminal type.

Once the terminfo entry is retrieved, the window size, backspace, interrupt and line kill characters (among many other things)
are set and the terminal and tab initialization strings are sent to the standard error output. Finally, if the erase, inter‐
rupt and line kill characters have changed, or are not set to their default values, their values are displayed to the standard
error output. Use the -c or -w option to select only the window sizing versus the other initialization. If neither option is
given, both are assumed.

When invoked as reset, tset sets cooked and echo modes, turns off cbreak and raw modes, turns on newline translation and resets
any unset special characters to their default values before doing the terminal initialization described above. This is useful
after a program dies leaving a terminal in an abnormal state. Note, you may have to type

<LF>reset<LF>

(the line-feed character is normally control-J) to get the terminal to work, as carriage-return may no longer work in the
abnormal state. Also, the terminal will often not echo the command.
 
Old 10-06-2015, 10:13 AM   #12
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 730

Rep: Reputation: 145Reputation: 145
Quote:
Originally Posted by sabsac View Post
Please see attachment.It makes no difference.
By any chance did you run a package manager - vi - cat - less et all before clear?

I have noticed that happened a few times when running vi based commands at one time but magically stopped doing it after an uodate. Cannot remember the distro though.
 
Old 10-06-2015, 10:52 AM   #13
cynwulf
Senior Member
 
Registered: Apr 2005
Location: Walsall, UK
Posts: 1,851
Blog Entries: 5

Rep: Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916
Quote:
Originally Posted by Ztcoracat View Post
Hi & Welcome to Linux Questions.

Open your terminal and type:

Code:
history -c
and hit Enter-
This is for clearing shell command history, not clearing the terminal screen.

The behaviour of "clear" (tput clear) is fairly standard. reset will also not usually clear the terminal window.
 
Old 10-06-2015, 01:13 PM   #14
sabsac
LQ Newbie
 
Registered: Sep 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Well this issue is not actually a problem for me just that I thought I had a bug in my system and it was not functioning the way it should.
 
Old 10-06-2015, 08:57 PM   #15
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware
Posts: 7,098
Blog Entries: 9

Rep: Reputation: Disabled
Quote:
Originally Posted by sabsac View Post
Well this issue is not actually a problem for me just that I thought I had a bug in my system and it was not functioning the way it should.
Did the clear cmd work for you?
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
clear command is not working mq15 Linux - Newbie 4 04-25-2009 10:27 PM
clear command sud Linux - Newbie 1 04-23-2009 01:54 AM
how do i replace the clear "clear screen" with the cls command thefedexguy SUSE / openSUSE 2 12-02-2005 05:02 PM
history clear command suguname Linux - Newbie 5 03-05-2005 09:32 AM
Always clear last command GUIPenguin Linux - General 3 09-14-2004 04:45 PM


All times are GMT -5. The time now is 08:24 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration