[plug] question about file types

Paul Wilson hooker at opera.iinet.net.au
Wed Jan 6 07:51:43 WST 1999


> This is just a minor annoyance, but when I'm exploring my Redhat system,
sometimes I can't tell by the ls -l whether a file is a binary or a script.
 So I just 'more' 'em.  
> Problem is, <sheepish grin> as often as not I open a binary file and it
mucks up my console.  Total garbage on screen, as if the font has been
changed to hieroglyphs.  
> 1) is there a way to determine if a file is a readable script or a
binary?
> 2) is there a quick and easy way to restore the VGA settings?  
> Logging out and back in fixes it, but seems rather inelegant to me.
> 
> Tamara

Try :

	file <fred>

There's a text file called /etc/magic which holds a list of patterns
together with a message associated with each. The 'file' command reads
/etc/magic and hops through the patterns until one matches, when it does
you get the message printed. It's a file that you occasionally have to mess
with (like adding matches for Perl scripts or Java class files).

Can't remember about the console settings though (someone else on this list
will !), but I know it's possible because I've had to do it myself in the
distant past.

Paul


More information about the plug mailing list