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

FAQ
It is currently Mon Oct 21, 2019 4:32 am


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

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
Font size:
 
Font colour
Options:
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:

Code:
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


Code:
clear

or
Code:
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:
Code:
# cat .inputrc
control-a: clear-screen


You can also set a combination of three keys to perform clear.
Jump to:  
News 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 ]



phpBB SEO