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

FAQ
It is currently Sun Sep 24, 2017 6:20 pm


System administration, processes administration, jobs, cron, resources, limits, shells, ssh, telnet.

Author Message
mandrei99
Post  Post subject: Linux clear screen / terminal  |  Posted: Tue Mar 03, 2015 8:20 am

Joined: Tue Aug 04, 2009 9:16 am
Posts: 245

Offline
 

Linux clear screen / terminal

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.





Top
mandrei99
Post  Post subject: Re: Linux clear screen / terminal  |  Posted: Tue Mar 03, 2015 8:27 am

Joined: Tue Aug 04, 2009 9:16 am
Posts: 245

Offline
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.


Top
Guest
Post  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.


Top
Display posts from previous:  Sort by  
E-mail friendPrint view

Topics related to - "Linux clear screen / terminal"
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. Squid clear cache on FreeBSD

mandrei99

0

1604

Mon Mar 03, 2014 7:37 am

mandrei99 View the latest post

There are no new unread posts for this topic. How to clear and initialize squid cache

mandrei99

0

1720

Thu Jan 08, 2015 5:29 am

mandrei99 View the latest post

There are no new unread posts for this topic. How to list PCI devices in Linux - lspci

mandrei99

0

1344

Mon Jul 22, 2013 10:03 am

mandrei99 View the latest post

There are no new unread posts for this topic. Linux: List kernel supported filesystems

debuser

0

451

Tue Mar 10, 2015 5:45 pm

debuser View the latest post

There are no new unread posts for this topic. Linux: list block devices UUID

debuser

0

842

Tue Mar 10, 2015 5:46 pm

debuser View the latest post

There are no new unread posts for this topic. How to prevent Linux SSH client from disconnecting using ServerAliveInterval

mandrei99

0

14959

Fri Jan 09, 2015 8:26 pm

mandrei99 View the latest post

There are no new unread posts for this topic. Change default editor to VI in Debian Linux

mandrei99

0

664

Fri Jan 16, 2015 6:59 pm

mandrei99 View the latest post

There are no new unread posts for this topic. How to print filesystem super block information in Linux

mandrei99

0

7200

Mon Jul 08, 2013 6:56 am

mandrei99 View the latest post

There are no new unread posts for this topic. How to list the largest files in a directory in Linux/FreeBSD

mandrei99

0

568

Thu Jan 22, 2015 5:14 pm

mandrei99 View the latest post

There are no new unread posts for this topic. Checking Linux virtual memory page size

mandrei99

0

472

Mon Feb 09, 2015 4:53 pm

mandrei99 View the latest post

 

Who is online
Users browsing this forum: No registered users and 0 guests
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
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