Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

It is currently Wed Apr 14, 2021 6:14 am

Message body:
Enter your message here, it may contain no more than 60000 characters. 

:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
Font size:
Font colour
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation code
Confirmation code:
In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.

Topic review - Linux clear screen / terminal
Author Message
Post subject: Re: Linux clear screen / terminal  |  Post Posted: Wed Mar 04, 2015 8:52 am
The Control+L works also if shell line contains characters. It will clear the screen up to the current terminal line and will keep typed characters.
Post subject: Re: Linux clear screen / terminal  |  Post Posted: Tue Mar 03, 2015 8:27 am
If you need to clear the contents your screen very fast, depending on your shell, you can use either clear command, or ^L (Ctrl+L) combination, if you're using bash shell.

^L is available on bash shell, while clear is available on most UNIX releases and on most shells. I've tested it on AIX, Red Hat and FreeBSD on sh, bash, ksh.

Also, you can issue the simple clear command and your screen will be cleared or add it as an alias for one key:

alias a='clear'

and pressing a key and then ENTER, your teminal will be cleared.
Post subject: Linux clear screen / terminal  |  Post Posted: Tue Mar 03, 2015 8:20 am
Linux clear screen terminal and move the shell prompt to the top of the screen.

Linux terminal can get filled with a lot of text if you use cat instead of less or more or if you are grepping a file for a pattern that is very loose.

Also, if you login via a serial console and the shell prompt gets moved in the middle of the screen overlapping with previous boot screen messages.

Clear Linux screen terminal


CTRL + l
(CTRL key + lowercase L)

The above methods will both work to clear the output on your shell screen when you want to capture new output.

Change Linux clear screen key combination

While Control + l key works by default to clear the linux screen, this combination can be changed in the .inputrc file. For example, to change the clear screen combination to CTROL+a add this to ~/.inputrc file and relogin:
# cat .inputrc
control-a: clear-screen

You can also set a combination of three keys to perform clear.
Jump to:  
cronNews News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list

Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]