Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Nano calls it ^L, but of course, typing something like

$ grep -v "^\^L" file

doesn't work. Its unicode codepoint is 000C. How can I match it in a regular expression?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

That seems to be the good old form feed character, described in man ascii as:

Oct   Dec   Hex   Char
------------------------------------------
014   12    0C    FF  '\f' (form feed)

(Not mentioned there, but ^L's code is the same 12.)

Then in bash any of these should work:

grep -v $'^\f' file

grep -v $'^\cL' file

grep -v $'\x0C' file
share|improve this answer
1  
That explains why ^L works to clean up the the screen. For example, when you're on console, editing a file, and syslog is spamming the console. Thanks. –  Tim Kennedy Nov 26 '11 at 19:39
    
in case anyone else is reading this to find out, kwrite regular expressions accept \f to represent this character –  ixtmixilix Feb 17 '12 at 12:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.