Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Jul 2002 22:57:54 +0100
From:      Daniel Bye <dan@slightlystrange.org>
To:        questions@freebsd.org
Subject:   Re: "^L" File, needs to be Removed
Message-ID:  <20020717215754.GE634@catflap.home.slightlystrange.org>
In-Reply-To: <002501c22dd9$27a47e40$7b01a8c0@afi>
References:  <002501c22dd9$27a47e40$7b01a8c0@afi>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jul 17, 2002 at 05:30:21PM -0400, lists@brenius.com wrote:
> server /etc/namedb/ # ls -la |more
> total 970
> -rw-r--r--   1 bind  bind   -    552 Aug  8  2000 ^L
> drwxr-xr-x   2 bind  wheel  -  10240 Jul 17 17:06 ./
> drwxr-xr-x  19 root  wheel  -   2560 Jul 17 17:20 ../
> 
> Can only be opened via (editor of choice) ?, e.g. pico ?
> 
> The file contains a zone file, from ages ago, but the original zone file is fine and
> is still there.
> 
> Even after a quick secondary backup of the whole directory, I am hesitant to
> perform a rm ? because the directory contains 100's of critical zone files.
> 
> Any safe way to remove it and why sometimes after an ls -la the file comes up
> as ^L and other times ? and only can be opened when you specify ?

# rm -i -- ?

The -i will at least prompt you before deleting the file, in case you 
change your mind or you have multiple files in the directory with a single
character name.  (Although, as I just found when I made a file called
"^L", your shell will likely interpret it as the "clear screen" character,
so you won't actually see the confirmation message from rm anyway!  Should
have seen that one coming...)

Incidentally, the "--" trick works with less, and various others, too.

It shows up in directory listings as "?" because that is the default 
action for ls when it encounters a non-printing character and the output
stream is attached to stdout.  You can use ls -B to show the characters' 
octal value, or ls -b to display them, where possible, as C escape 
characters.

Dan

-- 
Daniel Bye

PGP Key: ftp://ftp.slightlystrange.org/pgpkey/dan.asc
PGP Key fingerprint: 3D73 AF47 D448 C5CA 88B4 0DCF 849C 1C33 3C48 2CDC
                                                                     _
                                              ASCII ribbon campaign ( )
                                         - against HTML, vCards and  X
                                - proprietary attachments in e-mail / \

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020717215754.GE634>