Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Anyone have a package (unRAID or Slackware) for the unix 'clear' command?

Featured Replies

It's really frustrating as a scripter to not have that available.  Thought I would ask before I dug into it ;)

It's really frustrating as a scripter to not have that available.  Thought I would ask before I dug into it ;)

Try this  (This will work with most of the ansi/vt100/xterm terminal emulations):

echo -n -e "\033[H\033[2J"

 

you could create an alias in your script or in your execution profile, but depending on how you invoke your script, and where you define the alias, it might/might-not be available in the script.

 

alias clear='echo -n -e "\033[H\033[2J"'

 

 

Joe L.

  • Author

Thanks!

The good old days: VT100, VT220...

Did you actually use a real vt100 as a terminal?  ( I did, and many older terminals that preceded it, as it replaced a mechanical TTY )

The good old days: VT100, VT220...

Did you actually use a real vt100 as a terminal?  ( I did, and many older terminals that preceded it, as it replaced a mechanical TTY )

I am afraid I am that old school... started even with a VT52 :)

another one I put in my GO script to prevent the console from blanking is:

 

setterm -powersave off -blank 0

 

Myk

 

The good old days: VT100, VT220...

Did you actually use a real vt100 as a terminal?  ( I did, and many older terminals that preceded it, as it replaced a mechanical TTY )

I am afraid I am that old school... started even with a VT52 :)

It is worse than that for me I'm afraid...  the first mechanical TTY was murray/baudot model 28 and it was the I/O device for a very very early electronic switching machine running the biggest PBX made at the time by AT&T/Bell Labs. http://omahatelephonehistory.blogspot.com/2010/03/101-ess.html

Model 28 TTY as used in 101 ESS

got to love those bells.  It only had upper case, and there was no "clear screen" unless you ripped the paper off of its carriage.

It's really frustrating as a scripter to not have that available.  Thought I would ask before I dug into it ;)

Try this  (This will work with most of the ansi/vt100/xterm terminal emulations):

echo -n -e "\033[H\033[2J"

 

you could create an alias in your script or in your execution profile, but depending on how you invoke your script, and where you define the alias, it might/might-not be available in the script.

 

alias clear='echo -n -e "\033[H\033[2J"'

Wow, you've gotta be kidding me! I am so happy to have this (now saved and archived away). I have no idea how from the above command one might remember it as 'clear' but it's impressive some of you somehow make sense of it.

You can also get 'clear' on ncurses slackware package, anyway the alias solution will save you some ram for sure :)

It is worse than that for me I'm afraid...  the first mechanical TTY was murray/baudot model 28 and it was the I/O device for a very very early electronic switching machine running the biggest PBX made at the time by AT&T/Bell Labs. http://omahatelephonehistory.blogspot.com/2010/03/101-ess.html

Model 28 TTY as used in 101 ESS

got to love those bells.  It only had upper case, and there was no "clear screen" unless you ripped the paper off of its carriage.

 

Joe, you have a long history :)

 

Baudot code, that is ancient... in those days they couldn't even count to 8 bits

 

 

  • 3 weeks later...

It is worse than that for me I'm afraid...  the first mechanical TTY was murray/baudot model 28 and it was the I/O device for a very very early electronic switching machine running the biggest PBX made at the time by AT&T/Bell Labs. http://omahatelephonehistory.blogspot.com/2010/03/101-ess.html

Model 28 TTY as used in 101 ESS

got to love those bells.  It only had upper case, and there was no "clear screen" unless you ripped the paper off of its carriage.

 

Joe, you have a long history :)

 

Baudot code, that is ancient... in those days they couldn't even count to 8 bits

I'm afraid it was even worse than that.  The keyboard on that TTY had most of the keys removed.  It only allowed input in "hex", BUT the hex was not the standard notation we use today, but

-  (dash) = 0

1  through 9, representing 1 through 9

0  representing decimal 10

M representing decimal 11

S  representing decimal 12

C  representing decimal 13

T  representing decimal 14

R  representing decimal 15

 

The 0 representing a decimal 10 was equivalent to a 0 on the dial telephone being 10 pulses on the line...  Those old Bell-labs engineers were old-school for sure.

 

Commands to that 101-ESS PBX were all in that non-standard HEX.  You could tell it did not have a very fancy input syntax parsing scheme. (boy, I hope I remembered that weird hex right... it has been 40 years... probably does not matter, not many (relative) old-timers around to dispute me that worked on it...)   

 

What makes me feel like I have a long "history" is using computer programming languages, and remembering some of their syntax, that have absolutely no record existing (that I could find) on the web today.    :( :(

 

Joe L.

 

 

  • 1 month later...

Where can I put the alias clear='echo -n -e "\033[H\033[2J"' so it would load automaticly every time I login to my server, either on the console or via putty ?

thanks in advance

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.