Post subject: Re: Linux clear screen / terminal | 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.
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.
mandrei99
Post subject: Re: Linux clear screen / terminal | 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.
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'[/code]
and pressing a key and then ENTER, your teminal will be cleared.
mandrei99
Post subject: Linux clear screen / terminal | 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.
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 [b]cat[/b] instead of [b]less[/b] or [b]more[/b] 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.
[h2]Clear Linux screen terminal[/h2] [code] clear[/code] or [code]CTRL + l[/code](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.
[h2]Change Linux clear screen key combination[/h2] While Control + l key works by default to clear the linux screen, this combination can be changed in the [b].inputrc[/b] file. For example, to change the clear screen combination to CTROL+a add this to [b]~/.inputrc[/b] file and relogin: [code]# cat .inputrc control-a: clear-screen[/code]
You can also set a combination of three keys to perform clear.