Sveinbjorn Thordarson sent me an email detailing his new, free, open source, "Mac compatible" version of ls, lsmac. Here's what he had to say about it:
Thought you might be interested to know I've made a command line unix program similar to ls but with a Mac twist. It's called lsmac (48K download), and it sports the following features:- Lists the files within a directory
- Can display file size in human-readable format (i.e. 1.2MB instead of 12759024 bytes)
- Displays the size of all the file's forks, including the heritage resource fork, not just the data fork like ls!
- Displays file and creator types
- Displays the Finder flags that are set
Apple supplies command line utilities with the Developer Tools that share some of this functionality, but they operate on a single file basis. lsmac is free, open-source GPL'd software.
I tried lsmac this morning, and it works as described. Sveinbjorn provides two ways to install lsmac, using either a shell script installer or via a source compile. I tried both, and though they both worked, the shell script install automatically gives you the man page, which you otherwise need to copy by hand. The shell script installs lsmac in /usr/bin, but it's a two-second edit to point it elsewhere if you prefer (I used /usr/local/bin). Here's a small snippet of the output:
% lsmac
-C---- 8BPS 8BIM 201 KB 2002NewYear.psd
------ JPEG 8BIM 21 KB 2003newyear.jpg
------ TIFF ogle 7 KB 999 mark.tiff
------ JPEG 8BIM 211 KB bday_big.jpg
-C---- 8BPS 8BIM 1.7 MB birthday2.psd
-C---- JPEG GKON 119 KB calendar.jpg
------ 47 KB calendar.tiff
------ 4 items - Classic Scripts/
------ ???? ???? 3 KB config.php
------ 2 items - docs/
------ ???? ???? 18 KB english.php
------ TEXT R*ch 1 KB example of posting code
------ 11 KB FAQ text.txt
------ XLS8 XCEL 12 KB forum activity.xls
------ XLS8 XCEL 19 KB forum stats.xls
Getting the human-readable size is an added bonus (though I'd already installed new 'df' and 'du' commands to do that), and I really like seeing the type and creator info in the directory list. Definitely worth a look if you spend much time working with Mac files from the Terminal.