[Cialug] Display file contents either with less or cat based on number of lines

Don Ellis don.ellis at gmail.com
Tue Oct 25 16:07:37 CDT 2011


On Tue, Oct 25, 2011 at 9:30 AM, Paul Gray <gray at cs.uni.edu> wrote:
> On 10/25/2011 09:21 AM, Scott Prader wrote:
>>
>> Could probably write a wrapper for cat (maybe call it dog) and have it
>> reference /etc/mine.types and/or the file command so that once it
>> understands the 'scent' of the file, it will know how to process the
>> file based off of the preferred application for it.  For instance, if
>> you ran the command:
>>
>> dog kitty.jpg
>>
>> , it should know to figure out that it's an image file (file kitty.jpg),
>> check the environment (is ${DISPLAY} set?), figure out which application
>> to use (cross reference with mime.types depending on the environment),
>> and run the appropriate command to display the image.
>
> On a Mac, isn't this just the "open" command?

Or, from the GUI, hit the spacebar to view contents (if the proper app
is present)...

Yes, open works great when you're at the CLI.

--Don Ellis


More information about the Cialug mailing list