[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dir /s *.* equivalent for unix.

On Tue, Jul 07, 1998 at 09:54:04AM -0400, Stephen J. Carpenter wrote:
> On Mon, Jul 06, 1998 at 08:19:36PM -0700, Christopher Barry wrote:
> 2) The "file extension" is only as usefull as you trust it ;)
> unlike most DOS applications, it is rather uncommon for an application
> in a Unix-like environment to make assumptions based on filenames.

I like the "file" utility for this, for example:
brinkmds@flora:~$ file *
bin:                       setgid directory
CLICK2.WAV:                Microsoft RIFF, WAVE audio data, 8 bit, mono
11025 Hz
debian:                    directory
debs:                      setgid directory
diary:                     International language text
dsssl:                     setgid directory
funstuff:                  setgid directory
glademm-0.1.3.tar.gz:      gzip compressed data, deflated, last modified: Tue Jul  7 14:20:36 1998, max compression, os: Unix
libgtkmm_0.9.4-1_i386.deb: current ar archive
linux-2.1.106.tar.bz2:     bzip2 compressed data, block size = 900k
Mail:                      directory
Office40:                  directory
postponed:                 empty
projects:                  setgid directory
spinach_mid:               uuencoded or xxencoded text
test:                      setgid directory
TODO:                      ASCII text
TODO.books:                English text
uni:                       setgid directory
xpsw1.zip:                 Zip archive data, at least v2.0 to extract
zip+hp.txt:                English text

It uses magic codes in the files to determine (or guess ;) the file format
and read additional information.

It works great. See how it recognizes the *.deb format correctly as an
ar-archive, and how it tells me about the *.wav file. It even tells me that
I don't have postponed mail at the moment :)

It is not every time correct, for example:
brinkmds@flora:~$ file .Xauthority
.Xauthority:            X11 SNF font data, MSB first

But Xauthority file is only random binary data anyway...


"Rhubarb is no Egyptian god."        Debian GNU/Linux        finger brinkmd@ 
Marcus Brinkmann                   http://www.debian.org    master.debian.org
Marcus.Brinkmann@ruhr-uni-bochum.de                        for public  PGP Key
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/       PGP Key ID 36E7CD09

Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null

Reply to: