supercrabtree / k

k is the new l, yo
1.78k stars 123 forks source link

Listing of the filetype, perhaps using `file` #78

Closed ELLIOTTCABLE closed 6 years ago

ELLIOTTCABLE commented 7 years ago

Something I've wanted out of ls for a very, very long time, is display of the file-invocation results for each file.

For instance:

> file -bz ~/Downloads/*
PDF document, version 1.4
JPEG image data, JFIF standard 1.02, aspect ratio, density 1x1, segment length 16, progressive, precision 8, 1536x2048, frames 3
PDF document, version 1.6
directory
Zip archive data, at least v1.0 to extract
VAX COFF executable not stripped
VAX COFF executable not stripped
Zip archive data, at least v2.0 to extract
zlib compressed data
WebM
PDF document, version 1.4
Microsoft PowerPoint 2007+

This invocation was blazing-fast on my machine; it seems very reasonable to include this information in k, especially if it's behind an option? (file can be instructed to spit out only the mime-types with --mime-type; this might be the best output format for a columnar-display like k.)

supercrabtree commented 6 years ago

If you'd like to submit a PR I'd be happy to review, but not something I have time to code for you sorry.