Ctrl+L in terminal Announcing the arrival of Valued Associate #679: Cesar Manara ...

Time evolution of a Gaussian wave packet, why convert to k-space?

Project Euler #1 in C++

What would you call this weird metallic apparatus that allows you to lift people?

Is CEO the "profession" with the most psychopaths?

Has negative voting ever been officially implemented in elections, or seriously proposed, or even studied?

Why does it sometimes sound good to play a grace note as a lead in to a note in a melody?

What order were files/directories output in dir?

What initially awakened the Balrog?

What does 丫 mean? 丫是什么意思?

Do wooden building fires get hotter than 600°C?

What to do with repeated rejections for phd position

How would a mousetrap for use in space work?

How long can equipment go unused before powering up runs the risk of damage?

preposition before coffee

Dynamic filling of a region of a polar plot

Crossing US/Canada Border for less than 24 hours

Tannaka duality for semisimple groups

Deconstruction is ambiguous

Putting class ranking in CV, but against dept guidelines

What does it mean that physics no longer uses mechanical models to describe phenomena?

How can I prevent/balance waiting and turtling as a response to cooldown mechanics

What are the discoveries that have been possible with the rejection of positivism?

Why are my pictures showing a dark band on one edge?

What is best way to wire a ceiling receptacle in this situation?



Ctrl+L in terminal



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)How to reverse the effect of Ctrl + L in bash?Shortcut to clear command line terminalCtrl+Alt+T brings up Trash folder, not a Terminal?Ctrl+Alt+T doesn't open Terminal (Compiz related?)CTRL-F Opens TerminalCTRL+ALT+T not workingDisabling <ctrl>+<super>+<down> shortcutTerminal Short-cut ctrl + alt + T, 2 terminals, different sizeRemove <Super>L lock screen shortcutCtrl + C & Ctrl + V not working in 16.0416.04 — Reassign Ctrl + Alt + Numpad 0 (minimize window) shortcutctrl-alt-t opens new terminal window instead of new tab while gnome terminal is active window





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







38















I accidentally typed ctrl + L in terminal and my terminal window jumped one 'screenful' size. I looked at the keyboard shortcuts in "Edit"->"Keyboard shortcuts" and didn't find that shortcut.



What does ctrl + L do and where is it defined?










share|improve this question





























    38















    I accidentally typed ctrl + L in terminal and my terminal window jumped one 'screenful' size. I looked at the keyboard shortcuts in "Edit"->"Keyboard shortcuts" and didn't find that shortcut.



    What does ctrl + L do and where is it defined?










    share|improve this question

























      38












      38








      38


      5






      I accidentally typed ctrl + L in terminal and my terminal window jumped one 'screenful' size. I looked at the keyboard shortcuts in "Edit"->"Keyboard shortcuts" and didn't find that shortcut.



      What does ctrl + L do and where is it defined?










      share|improve this question














      I accidentally typed ctrl + L in terminal and my terminal window jumped one 'screenful' size. I looked at the keyboard shortcuts in "Edit"->"Keyboard shortcuts" and didn't find that shortcut.



      What does ctrl + L do and where is it defined?







      command-line shortcut-keys






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 14 '14 at 15:16









      PartoParto

      9,6121967105




      9,6121967105






















          4 Answers
          4






          active

          oldest

          votes


















          54














          ctrl + L just clear the terminal screen.



          It is the keyboard shortcut equivalent of the command clear -x. ref



          It is property of bash, so you did not found it under keyboard shortcuts in your gnome-terminal. From man bash:



          clear-screen (C-l)
          Clear the screen leaving the current line at the top of the
          screen. With an argument, refresh the current line without
          clearing the screen.


          See a detail list of Bash Keyboard Shortcuts.






          share|improve this answer


























          • Oh, that explains it.

            – Parto
            Mar 14 '14 at 15:28






          • 2





            It's not just bash though; Ctrl-L is the form-feed character. It's not so common, but sometimes you'll see ^L in source code separating "pages" of code. It made more sense when a printer would interpret it as a control character.

            – Joshua Taylor
            Mar 14 '14 at 17:37













          • @JoshuaTaylor you are correct. Related wiki article on Page break

            – souravc
            Mar 14 '14 at 18:41






          • 1





            ^L is the form-feed character in the ascii table, but that doesn't do anything unless it is received by a program that treats it accordingly (either bash or the terminal emulator, in this context).

            – alexis
            Mar 15 '14 at 12:38






          • 1





            Note that it is not the equivalent of the default command clear, because it doesn't erase your terminal history, while the command clear does, unless you add the -x argument, like so: clear -x.

            – jirislav
            11 hours ago



















          17














          If the shell you're using is not intercepting it, you are typing a "Form-feed" character in your terminal. If the terminal application does not intercept or use the keystroke in some way, Ctrl+Letter is translated to the ASCII code of the letter minus 64(1). 65 is the ASCII code of 'A', 'L' is the 12th letter -> code 76. If the shell does not know what to do of the code, it prints it.



          Printing a FF char resulted in a new page on a line printer and a clear screen on the terminal (yes, I used a VT-52 back then, at 300 baud).



          So Ctrl+L is 12 which is FF. In the same way, Ctrl+I is a TAB, and Ctrl+G rings the bell --- if the terminal or the shell does not intercept it, like Ctrl+C for example.



          Notice from the other answer: it seems that bash do intercept CTRL-L and do a clear. Nice touch that the bash authors associated the key with a command which will do more or less the same that the ASCII code did on old terminals!



          On the other hand, in my zsh the combination CTRL-I works as TAB and CTRL-H as a Backspace(2).



          Old nice ASCII... (notice that letter L is at column 4, row 12, it has ASCII code 4*16+12=76).



          Image from Wikimedia commons



          Original Image here, from wikipedia article on ASCII.






          Footnotes:

          (1) Ctrl really used to clear the bit 7.



          (2) this is the source of the "fail to remove word" joke you sometime find like for example "this was a bad^H^H^Hnot so nice idea"... (with normally a word stronger than bad!)






          share|improve this answer





















          • 1





            Nice. How do I use this chart by the way? I can see that letter L is at row 12 and column 4. Do I then just minus 32 from the 124 or how do you calculate the ASCII code?

            – Parto
            Mar 14 '14 at 15:35











          • @AvatarParto ups, wrote 32 instead of 65. Answer corrected. The table is binary, so the code is column*16+row.

            – Rmano
            Mar 14 '14 at 15:52






          • 1





            Inserting literal ^Hs or ^Ws is nice when you can't use strikethroughs. :)

            – Blacklight Shining
            Mar 14 '14 at 23:47



















          7














          Control-L is intercepted and interpreted by bash (actually by the readline library, which handles interactive editing on the command line). It is bound to the clear-screen function, as @souravc wrote.



          Note on the meaning of Control-L: It is defined as Form Feed in the ASCII character table, but this means nothing unless some program interprets it accordingly. The terminal does not clear the screen when it sees a form feed, as you can verify by by saving a ^L in a file and printing the file with cat. When bash/readline sees the ^L, it executes the clear-screen function. This sends a sequence of characters that is understood by your terminal emulator (as described by termcap or terminfo), and has the effect of clearing the screen.



          In very old printers, a ^L would advance the paper start printing on the next sheet, hence the name "form feed". But modern terminals and terminal emulators follow a newer ANSI standard, in which control commands are multi-character "escape codes" that begin with ^[ (escape). When bash sees your ^L, it is probably sending the two-command sequence ESC [ H ESC [ J, which moves to the top left of the screen and clears everything below it (hence the whole screen).






          share|improve this answer
























          • Actually, the sequence ESC [ ESC [ J also clears the command history, whilst the CTRL + L sequence doesn't. The sequence sent to the terminal is rather ESC [ H ESC [ 2 J, go ahead an try it yourself with this command: printf "33[H33[2J".

            – jirislav
            11 hours ago



















          0














          As everyone already explained pretty well what Ctrl+L is and does, but no one explained how to "reverse" the command, here a few commands you can type to get you back to what you were doing:



          history


          will give you the last 20 commands you typed.



          tail --lines=20 /var/log/dpkg.log


          will give you the last 20 lines of output of any package installation you were performing






          share|improve this answer






















            protected by souravc Dec 19 '17 at 12:43



            Thank you for your interest in this question.
            Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



            Would you like to answer one of these unanswered questions instead?














            4 Answers
            4






            active

            oldest

            votes








            4 Answers
            4






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            54














            ctrl + L just clear the terminal screen.



            It is the keyboard shortcut equivalent of the command clear -x. ref



            It is property of bash, so you did not found it under keyboard shortcuts in your gnome-terminal. From man bash:



            clear-screen (C-l)
            Clear the screen leaving the current line at the top of the
            screen. With an argument, refresh the current line without
            clearing the screen.


            See a detail list of Bash Keyboard Shortcuts.






            share|improve this answer


























            • Oh, that explains it.

              – Parto
              Mar 14 '14 at 15:28






            • 2





              It's not just bash though; Ctrl-L is the form-feed character. It's not so common, but sometimes you'll see ^L in source code separating "pages" of code. It made more sense when a printer would interpret it as a control character.

              – Joshua Taylor
              Mar 14 '14 at 17:37













            • @JoshuaTaylor you are correct. Related wiki article on Page break

              – souravc
              Mar 14 '14 at 18:41






            • 1





              ^L is the form-feed character in the ascii table, but that doesn't do anything unless it is received by a program that treats it accordingly (either bash or the terminal emulator, in this context).

              – alexis
              Mar 15 '14 at 12:38






            • 1





              Note that it is not the equivalent of the default command clear, because it doesn't erase your terminal history, while the command clear does, unless you add the -x argument, like so: clear -x.

              – jirislav
              11 hours ago
















            54














            ctrl + L just clear the terminal screen.



            It is the keyboard shortcut equivalent of the command clear -x. ref



            It is property of bash, so you did not found it under keyboard shortcuts in your gnome-terminal. From man bash:



            clear-screen (C-l)
            Clear the screen leaving the current line at the top of the
            screen. With an argument, refresh the current line without
            clearing the screen.


            See a detail list of Bash Keyboard Shortcuts.






            share|improve this answer


























            • Oh, that explains it.

              – Parto
              Mar 14 '14 at 15:28






            • 2





              It's not just bash though; Ctrl-L is the form-feed character. It's not so common, but sometimes you'll see ^L in source code separating "pages" of code. It made more sense when a printer would interpret it as a control character.

              – Joshua Taylor
              Mar 14 '14 at 17:37













            • @JoshuaTaylor you are correct. Related wiki article on Page break

              – souravc
              Mar 14 '14 at 18:41






            • 1





              ^L is the form-feed character in the ascii table, but that doesn't do anything unless it is received by a program that treats it accordingly (either bash or the terminal emulator, in this context).

              – alexis
              Mar 15 '14 at 12:38






            • 1





              Note that it is not the equivalent of the default command clear, because it doesn't erase your terminal history, while the command clear does, unless you add the -x argument, like so: clear -x.

              – jirislav
              11 hours ago














            54












            54








            54







            ctrl + L just clear the terminal screen.



            It is the keyboard shortcut equivalent of the command clear -x. ref



            It is property of bash, so you did not found it under keyboard shortcuts in your gnome-terminal. From man bash:



            clear-screen (C-l)
            Clear the screen leaving the current line at the top of the
            screen. With an argument, refresh the current line without
            clearing the screen.


            See a detail list of Bash Keyboard Shortcuts.






            share|improve this answer















            ctrl + L just clear the terminal screen.



            It is the keyboard shortcut equivalent of the command clear -x. ref



            It is property of bash, so you did not found it under keyboard shortcuts in your gnome-terminal. From man bash:



            clear-screen (C-l)
            Clear the screen leaving the current line at the top of the
            screen. With an argument, refresh the current line without
            clearing the screen.


            See a detail list of Bash Keyboard Shortcuts.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 13 mins ago

























            answered Mar 14 '14 at 15:20









            souravcsouravc

            28k1378109




            28k1378109













            • Oh, that explains it.

              – Parto
              Mar 14 '14 at 15:28






            • 2





              It's not just bash though; Ctrl-L is the form-feed character. It's not so common, but sometimes you'll see ^L in source code separating "pages" of code. It made more sense when a printer would interpret it as a control character.

              – Joshua Taylor
              Mar 14 '14 at 17:37













            • @JoshuaTaylor you are correct. Related wiki article on Page break

              – souravc
              Mar 14 '14 at 18:41






            • 1





              ^L is the form-feed character in the ascii table, but that doesn't do anything unless it is received by a program that treats it accordingly (either bash or the terminal emulator, in this context).

              – alexis
              Mar 15 '14 at 12:38






            • 1





              Note that it is not the equivalent of the default command clear, because it doesn't erase your terminal history, while the command clear does, unless you add the -x argument, like so: clear -x.

              – jirislav
              11 hours ago



















            • Oh, that explains it.

              – Parto
              Mar 14 '14 at 15:28






            • 2





              It's not just bash though; Ctrl-L is the form-feed character. It's not so common, but sometimes you'll see ^L in source code separating "pages" of code. It made more sense when a printer would interpret it as a control character.

              – Joshua Taylor
              Mar 14 '14 at 17:37













            • @JoshuaTaylor you are correct. Related wiki article on Page break

              – souravc
              Mar 14 '14 at 18:41






            • 1





              ^L is the form-feed character in the ascii table, but that doesn't do anything unless it is received by a program that treats it accordingly (either bash or the terminal emulator, in this context).

              – alexis
              Mar 15 '14 at 12:38






            • 1





              Note that it is not the equivalent of the default command clear, because it doesn't erase your terminal history, while the command clear does, unless you add the -x argument, like so: clear -x.

              – jirislav
              11 hours ago

















            Oh, that explains it.

            – Parto
            Mar 14 '14 at 15:28





            Oh, that explains it.

            – Parto
            Mar 14 '14 at 15:28




            2




            2





            It's not just bash though; Ctrl-L is the form-feed character. It's not so common, but sometimes you'll see ^L in source code separating "pages" of code. It made more sense when a printer would interpret it as a control character.

            – Joshua Taylor
            Mar 14 '14 at 17:37







            It's not just bash though; Ctrl-L is the form-feed character. It's not so common, but sometimes you'll see ^L in source code separating "pages" of code. It made more sense when a printer would interpret it as a control character.

            – Joshua Taylor
            Mar 14 '14 at 17:37















            @JoshuaTaylor you are correct. Related wiki article on Page break

            – souravc
            Mar 14 '14 at 18:41





            @JoshuaTaylor you are correct. Related wiki article on Page break

            – souravc
            Mar 14 '14 at 18:41




            1




            1





            ^L is the form-feed character in the ascii table, but that doesn't do anything unless it is received by a program that treats it accordingly (either bash or the terminal emulator, in this context).

            – alexis
            Mar 15 '14 at 12:38





            ^L is the form-feed character in the ascii table, but that doesn't do anything unless it is received by a program that treats it accordingly (either bash or the terminal emulator, in this context).

            – alexis
            Mar 15 '14 at 12:38




            1




            1





            Note that it is not the equivalent of the default command clear, because it doesn't erase your terminal history, while the command clear does, unless you add the -x argument, like so: clear -x.

            – jirislav
            11 hours ago





            Note that it is not the equivalent of the default command clear, because it doesn't erase your terminal history, while the command clear does, unless you add the -x argument, like so: clear -x.

            – jirislav
            11 hours ago













            17














            If the shell you're using is not intercepting it, you are typing a "Form-feed" character in your terminal. If the terminal application does not intercept or use the keystroke in some way, Ctrl+Letter is translated to the ASCII code of the letter minus 64(1). 65 is the ASCII code of 'A', 'L' is the 12th letter -> code 76. If the shell does not know what to do of the code, it prints it.



            Printing a FF char resulted in a new page on a line printer and a clear screen on the terminal (yes, I used a VT-52 back then, at 300 baud).



            So Ctrl+L is 12 which is FF. In the same way, Ctrl+I is a TAB, and Ctrl+G rings the bell --- if the terminal or the shell does not intercept it, like Ctrl+C for example.



            Notice from the other answer: it seems that bash do intercept CTRL-L and do a clear. Nice touch that the bash authors associated the key with a command which will do more or less the same that the ASCII code did on old terminals!



            On the other hand, in my zsh the combination CTRL-I works as TAB and CTRL-H as a Backspace(2).



            Old nice ASCII... (notice that letter L is at column 4, row 12, it has ASCII code 4*16+12=76).



            Image from Wikimedia commons



            Original Image here, from wikipedia article on ASCII.






            Footnotes:

            (1) Ctrl really used to clear the bit 7.



            (2) this is the source of the "fail to remove word" joke you sometime find like for example "this was a bad^H^H^Hnot so nice idea"... (with normally a word stronger than bad!)






            share|improve this answer





















            • 1





              Nice. How do I use this chart by the way? I can see that letter L is at row 12 and column 4. Do I then just minus 32 from the 124 or how do you calculate the ASCII code?

              – Parto
              Mar 14 '14 at 15:35











            • @AvatarParto ups, wrote 32 instead of 65. Answer corrected. The table is binary, so the code is column*16+row.

              – Rmano
              Mar 14 '14 at 15:52






            • 1





              Inserting literal ^Hs or ^Ws is nice when you can't use strikethroughs. :)

              – Blacklight Shining
              Mar 14 '14 at 23:47
















            17














            If the shell you're using is not intercepting it, you are typing a "Form-feed" character in your terminal. If the terminal application does not intercept or use the keystroke in some way, Ctrl+Letter is translated to the ASCII code of the letter minus 64(1). 65 is the ASCII code of 'A', 'L' is the 12th letter -> code 76. If the shell does not know what to do of the code, it prints it.



            Printing a FF char resulted in a new page on a line printer and a clear screen on the terminal (yes, I used a VT-52 back then, at 300 baud).



            So Ctrl+L is 12 which is FF. In the same way, Ctrl+I is a TAB, and Ctrl+G rings the bell --- if the terminal or the shell does not intercept it, like Ctrl+C for example.



            Notice from the other answer: it seems that bash do intercept CTRL-L and do a clear. Nice touch that the bash authors associated the key with a command which will do more or less the same that the ASCII code did on old terminals!



            On the other hand, in my zsh the combination CTRL-I works as TAB and CTRL-H as a Backspace(2).



            Old nice ASCII... (notice that letter L is at column 4, row 12, it has ASCII code 4*16+12=76).



            Image from Wikimedia commons



            Original Image here, from wikipedia article on ASCII.






            Footnotes:

            (1) Ctrl really used to clear the bit 7.



            (2) this is the source of the "fail to remove word" joke you sometime find like for example "this was a bad^H^H^Hnot so nice idea"... (with normally a word stronger than bad!)






            share|improve this answer





















            • 1





              Nice. How do I use this chart by the way? I can see that letter L is at row 12 and column 4. Do I then just minus 32 from the 124 or how do you calculate the ASCII code?

              – Parto
              Mar 14 '14 at 15:35











            • @AvatarParto ups, wrote 32 instead of 65. Answer corrected. The table is binary, so the code is column*16+row.

              – Rmano
              Mar 14 '14 at 15:52






            • 1





              Inserting literal ^Hs or ^Ws is nice when you can't use strikethroughs. :)

              – Blacklight Shining
              Mar 14 '14 at 23:47














            17












            17








            17







            If the shell you're using is not intercepting it, you are typing a "Form-feed" character in your terminal. If the terminal application does not intercept or use the keystroke in some way, Ctrl+Letter is translated to the ASCII code of the letter minus 64(1). 65 is the ASCII code of 'A', 'L' is the 12th letter -> code 76. If the shell does not know what to do of the code, it prints it.



            Printing a FF char resulted in a new page on a line printer and a clear screen on the terminal (yes, I used a VT-52 back then, at 300 baud).



            So Ctrl+L is 12 which is FF. In the same way, Ctrl+I is a TAB, and Ctrl+G rings the bell --- if the terminal or the shell does not intercept it, like Ctrl+C for example.



            Notice from the other answer: it seems that bash do intercept CTRL-L and do a clear. Nice touch that the bash authors associated the key with a command which will do more or less the same that the ASCII code did on old terminals!



            On the other hand, in my zsh the combination CTRL-I works as TAB and CTRL-H as a Backspace(2).



            Old nice ASCII... (notice that letter L is at column 4, row 12, it has ASCII code 4*16+12=76).



            Image from Wikimedia commons



            Original Image here, from wikipedia article on ASCII.






            Footnotes:

            (1) Ctrl really used to clear the bit 7.



            (2) this is the source of the "fail to remove word" joke you sometime find like for example "this was a bad^H^H^Hnot so nice idea"... (with normally a word stronger than bad!)






            share|improve this answer















            If the shell you're using is not intercepting it, you are typing a "Form-feed" character in your terminal. If the terminal application does not intercept or use the keystroke in some way, Ctrl+Letter is translated to the ASCII code of the letter minus 64(1). 65 is the ASCII code of 'A', 'L' is the 12th letter -> code 76. If the shell does not know what to do of the code, it prints it.



            Printing a FF char resulted in a new page on a line printer and a clear screen on the terminal (yes, I used a VT-52 back then, at 300 baud).



            So Ctrl+L is 12 which is FF. In the same way, Ctrl+I is a TAB, and Ctrl+G rings the bell --- if the terminal or the shell does not intercept it, like Ctrl+C for example.



            Notice from the other answer: it seems that bash do intercept CTRL-L and do a clear. Nice touch that the bash authors associated the key with a command which will do more or less the same that the ASCII code did on old terminals!



            On the other hand, in my zsh the combination CTRL-I works as TAB and CTRL-H as a Backspace(2).



            Old nice ASCII... (notice that letter L is at column 4, row 12, it has ASCII code 4*16+12=76).



            Image from Wikimedia commons



            Original Image here, from wikipedia article on ASCII.






            Footnotes:

            (1) Ctrl really used to clear the bit 7.



            (2) this is the source of the "fail to remove word" joke you sometime find like for example "this was a bad^H^H^Hnot so nice idea"... (with normally a word stronger than bad!)







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jan 7 at 9:18









            Codito ergo sum

            1,5044925




            1,5044925










            answered Mar 14 '14 at 15:31









            RmanoRmano

            25.6k881148




            25.6k881148








            • 1





              Nice. How do I use this chart by the way? I can see that letter L is at row 12 and column 4. Do I then just minus 32 from the 124 or how do you calculate the ASCII code?

              – Parto
              Mar 14 '14 at 15:35











            • @AvatarParto ups, wrote 32 instead of 65. Answer corrected. The table is binary, so the code is column*16+row.

              – Rmano
              Mar 14 '14 at 15:52






            • 1





              Inserting literal ^Hs or ^Ws is nice when you can't use strikethroughs. :)

              – Blacklight Shining
              Mar 14 '14 at 23:47














            • 1





              Nice. How do I use this chart by the way? I can see that letter L is at row 12 and column 4. Do I then just minus 32 from the 124 or how do you calculate the ASCII code?

              – Parto
              Mar 14 '14 at 15:35











            • @AvatarParto ups, wrote 32 instead of 65. Answer corrected. The table is binary, so the code is column*16+row.

              – Rmano
              Mar 14 '14 at 15:52






            • 1





              Inserting literal ^Hs or ^Ws is nice when you can't use strikethroughs. :)

              – Blacklight Shining
              Mar 14 '14 at 23:47








            1




            1





            Nice. How do I use this chart by the way? I can see that letter L is at row 12 and column 4. Do I then just minus 32 from the 124 or how do you calculate the ASCII code?

            – Parto
            Mar 14 '14 at 15:35





            Nice. How do I use this chart by the way? I can see that letter L is at row 12 and column 4. Do I then just minus 32 from the 124 or how do you calculate the ASCII code?

            – Parto
            Mar 14 '14 at 15:35













            @AvatarParto ups, wrote 32 instead of 65. Answer corrected. The table is binary, so the code is column*16+row.

            – Rmano
            Mar 14 '14 at 15:52





            @AvatarParto ups, wrote 32 instead of 65. Answer corrected. The table is binary, so the code is column*16+row.

            – Rmano
            Mar 14 '14 at 15:52




            1




            1





            Inserting literal ^Hs or ^Ws is nice when you can't use strikethroughs. :)

            – Blacklight Shining
            Mar 14 '14 at 23:47





            Inserting literal ^Hs or ^Ws is nice when you can't use strikethroughs. :)

            – Blacklight Shining
            Mar 14 '14 at 23:47











            7














            Control-L is intercepted and interpreted by bash (actually by the readline library, which handles interactive editing on the command line). It is bound to the clear-screen function, as @souravc wrote.



            Note on the meaning of Control-L: It is defined as Form Feed in the ASCII character table, but this means nothing unless some program interprets it accordingly. The terminal does not clear the screen when it sees a form feed, as you can verify by by saving a ^L in a file and printing the file with cat. When bash/readline sees the ^L, it executes the clear-screen function. This sends a sequence of characters that is understood by your terminal emulator (as described by termcap or terminfo), and has the effect of clearing the screen.



            In very old printers, a ^L would advance the paper start printing on the next sheet, hence the name "form feed". But modern terminals and terminal emulators follow a newer ANSI standard, in which control commands are multi-character "escape codes" that begin with ^[ (escape). When bash sees your ^L, it is probably sending the two-command sequence ESC [ H ESC [ J, which moves to the top left of the screen and clears everything below it (hence the whole screen).






            share|improve this answer
























            • Actually, the sequence ESC [ ESC [ J also clears the command history, whilst the CTRL + L sequence doesn't. The sequence sent to the terminal is rather ESC [ H ESC [ 2 J, go ahead an try it yourself with this command: printf "33[H33[2J".

              – jirislav
              11 hours ago
















            7














            Control-L is intercepted and interpreted by bash (actually by the readline library, which handles interactive editing on the command line). It is bound to the clear-screen function, as @souravc wrote.



            Note on the meaning of Control-L: It is defined as Form Feed in the ASCII character table, but this means nothing unless some program interprets it accordingly. The terminal does not clear the screen when it sees a form feed, as you can verify by by saving a ^L in a file and printing the file with cat. When bash/readline sees the ^L, it executes the clear-screen function. This sends a sequence of characters that is understood by your terminal emulator (as described by termcap or terminfo), and has the effect of clearing the screen.



            In very old printers, a ^L would advance the paper start printing on the next sheet, hence the name "form feed". But modern terminals and terminal emulators follow a newer ANSI standard, in which control commands are multi-character "escape codes" that begin with ^[ (escape). When bash sees your ^L, it is probably sending the two-command sequence ESC [ H ESC [ J, which moves to the top left of the screen and clears everything below it (hence the whole screen).






            share|improve this answer
























            • Actually, the sequence ESC [ ESC [ J also clears the command history, whilst the CTRL + L sequence doesn't. The sequence sent to the terminal is rather ESC [ H ESC [ 2 J, go ahead an try it yourself with this command: printf "33[H33[2J".

              – jirislav
              11 hours ago














            7












            7








            7







            Control-L is intercepted and interpreted by bash (actually by the readline library, which handles interactive editing on the command line). It is bound to the clear-screen function, as @souravc wrote.



            Note on the meaning of Control-L: It is defined as Form Feed in the ASCII character table, but this means nothing unless some program interprets it accordingly. The terminal does not clear the screen when it sees a form feed, as you can verify by by saving a ^L in a file and printing the file with cat. When bash/readline sees the ^L, it executes the clear-screen function. This sends a sequence of characters that is understood by your terminal emulator (as described by termcap or terminfo), and has the effect of clearing the screen.



            In very old printers, a ^L would advance the paper start printing on the next sheet, hence the name "form feed". But modern terminals and terminal emulators follow a newer ANSI standard, in which control commands are multi-character "escape codes" that begin with ^[ (escape). When bash sees your ^L, it is probably sending the two-command sequence ESC [ H ESC [ J, which moves to the top left of the screen and clears everything below it (hence the whole screen).






            share|improve this answer













            Control-L is intercepted and interpreted by bash (actually by the readline library, which handles interactive editing on the command line). It is bound to the clear-screen function, as @souravc wrote.



            Note on the meaning of Control-L: It is defined as Form Feed in the ASCII character table, but this means nothing unless some program interprets it accordingly. The terminal does not clear the screen when it sees a form feed, as you can verify by by saving a ^L in a file and printing the file with cat. When bash/readline sees the ^L, it executes the clear-screen function. This sends a sequence of characters that is understood by your terminal emulator (as described by termcap or terminfo), and has the effect of clearing the screen.



            In very old printers, a ^L would advance the paper start printing on the next sheet, hence the name "form feed". But modern terminals and terminal emulators follow a newer ANSI standard, in which control commands are multi-character "escape codes" that begin with ^[ (escape). When bash sees your ^L, it is probably sending the two-command sequence ESC [ H ESC [ J, which moves to the top left of the screen and clears everything below it (hence the whole screen).







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 15 '14 at 13:00









            alexisalexis

            90968




            90968













            • Actually, the sequence ESC [ ESC [ J also clears the command history, whilst the CTRL + L sequence doesn't. The sequence sent to the terminal is rather ESC [ H ESC [ 2 J, go ahead an try it yourself with this command: printf "33[H33[2J".

              – jirislav
              11 hours ago



















            • Actually, the sequence ESC [ ESC [ J also clears the command history, whilst the CTRL + L sequence doesn't. The sequence sent to the terminal is rather ESC [ H ESC [ 2 J, go ahead an try it yourself with this command: printf "33[H33[2J".

              – jirislav
              11 hours ago

















            Actually, the sequence ESC [ ESC [ J also clears the command history, whilst the CTRL + L sequence doesn't. The sequence sent to the terminal is rather ESC [ H ESC [ 2 J, go ahead an try it yourself with this command: printf "33[H33[2J".

            – jirislav
            11 hours ago





            Actually, the sequence ESC [ ESC [ J also clears the command history, whilst the CTRL + L sequence doesn't. The sequence sent to the terminal is rather ESC [ H ESC [ 2 J, go ahead an try it yourself with this command: printf "33[H33[2J".

            – jirislav
            11 hours ago











            0














            As everyone already explained pretty well what Ctrl+L is and does, but no one explained how to "reverse" the command, here a few commands you can type to get you back to what you were doing:



            history


            will give you the last 20 commands you typed.



            tail --lines=20 /var/log/dpkg.log


            will give you the last 20 lines of output of any package installation you were performing






            share|improve this answer




























              0














              As everyone already explained pretty well what Ctrl+L is and does, but no one explained how to "reverse" the command, here a few commands you can type to get you back to what you were doing:



              history


              will give you the last 20 commands you typed.



              tail --lines=20 /var/log/dpkg.log


              will give you the last 20 lines of output of any package installation you were performing






              share|improve this answer


























                0












                0








                0







                As everyone already explained pretty well what Ctrl+L is and does, but no one explained how to "reverse" the command, here a few commands you can type to get you back to what you were doing:



                history


                will give you the last 20 commands you typed.



                tail --lines=20 /var/log/dpkg.log


                will give you the last 20 lines of output of any package installation you were performing






                share|improve this answer













                As everyone already explained pretty well what Ctrl+L is and does, but no one explained how to "reverse" the command, here a few commands you can type to get you back to what you were doing:



                history


                will give you the last 20 commands you typed.



                tail --lines=20 /var/log/dpkg.log


                will give you the last 20 lines of output of any package installation you were performing







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 3 '18 at 19:42









                FabbyFabby

                27.1k1360161




                27.1k1360161

















                    protected by souravc Dec 19 '17 at 12:43



                    Thank you for your interest in this question.
                    Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                    Would you like to answer one of these unanswered questions instead?



                    Popular posts from this blog

                    Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

                    Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

                    Simple Scan not detecting my scanner (Brother DCP-7055W)Brother MFC-L2700DW printer can print, can't...