Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Install a useful set of OS X specific command line apps UNIX
I found a neat set of command line utilties called osxutils, available on the sourceforge osxutils project page. The package Installs with an easy Apple installer. Summarized from the Read Me file, the included utilities are:
  • lsmac: Lists directory contents akin to the traditional ls command, but also shows Finder flags, heritage File and Creator types, displays size in human-readable format (i.e. 1.2 MB), and shows source files of Mac OS aliases.
  • setfctypes: Simple, direct interface for setting File and Creator types; processes many files quickly.
  • setfflags: View and set file Finder flags
  • setfcomment: Sets file comments, both Mac OS 9 viewable Desktop DB comments and OS X Finder comments.
  • cpath: Copies the current working directory path ($PWD) directly to the clipboard
  • setsuffix: Set, replace and remove file suffices/extensions
  • mkalias: Create MacOS aliases with an interface similar to that of ln.
I'm finding lsmac particularly useful and have aliased it to ls in my ~/.tcshrc file.

[robg adds: Normally we don't run general announcements of software packages, but in this case, the osxutils package is an extension of the lsmac script posted here a while back, which seemed relatively popular based on the comments -- so I thought this may be of general interest.]
    •    
  • Currently 2.75 / 5
  You rated: 4 / 5 (4 votes cast)
 
[12,207 views]  

Install a useful set of OS X specific command line apps | 19 comments | Create New Account
Click here to return to the 'Install a useful set of OS X specific command line apps' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Install a useful set of OS X specific command line apps
Authored by: onebear on Jun 02, '03 12:39:52PM

As my old UNIX friend always say to me; don't set an alias with the same name as another command like 'ls' for lsmac...
You might want to use it later...so set another alias!



[ Reply to This | # ]
alias
Authored by: macubergeek on Jun 02, '03 01:01:20PM

Heh, yeh thought of that after I hit submit ;-)
lsmac -->lsm



[ Reply to This | # ]
Install a useful set of OS X specific command line apps
Authored by: mattmoss on Jun 02, '03 02:41:36PM

Why not? I do it all the time. If I need to use the original ls command, I simply type: /bin/ls

Assuming the alias is the one used more frequently, this works just peachy.



[ Reply to This | # ]
Install a useful set of OS X specific command line apps
Authored by: greed on Jun 02, '03 02:59:41PM

To temporarily drop the alias, just quote the command like so:
\ls
'ls'
"ls"



[ Reply to This | # ]
Install a useful set of OS X specific command line apps
Authored by: IslandDan on Jun 03, '03 08:53:35AM

The reason not to is that shell scripts may use the command and fail.



[ Reply to This | # ]
Install a useful set of OS X specific command line apps
Authored by: carsten on Jun 03, '03 08:39:06PM

You can always "unalias ls" before running any script that requires the regular unix ls.

Probably better to just alias lsmac to something else besides "ls", such as "alias lsm lsmac".

Carsten



[ Reply to This | # ]
Man Pages
Authored by: FlyBoy on Jun 02, '03 01:37:45PM

I installed the binary and it didn't install the man pages, although the .bom file in the receipt said that it did. So I installed from source and the man pages were appropriately installed.

FlyBoy



[ Reply to This | # ]
Man Pages
Authored by: carsten on Jun 02, '03 03:46:51PM

Thanks, a new package is available on SF now which fixes this.

(The man files and docs weren't being installed as root.)



[ Reply to This | # ]
Man Pages
Authored by: osxpounder on Jun 03, '03 05:09:13PM

I just used the .pkg to install, and I can't find any evidence of man files [not that I know much about that]. All I can say for sure is that my current MANPATH environment variable is set to:

/usr/share/man:/usr/local/man:/usr/X11R6/man:/usr/local/bin:/usr/local/share/man/man1

... but that doesn't bring up a man page for lsmac, although man works for basics like ls .... where do you think the man pages are?

---
--
osxpounder



[ Reply to This | # ]
Man Pages .. found!
Authored by: osxpounder on Jun 03, '03 05:19:13PM

I figured it out! Turns out that my reasoning was flawed. I found what looked like the actual man page content files in /usr/local/share/man/man1 ..., but I experimented and found that I must leave off that last folder name when adding the path to my MANPATH variable. Long story short: it works when my MANPATH is set to:

/usr/local/share/man:/usr/share/man:/usr/local/man:/usr/X11R6/man:/usr/local/bin

I just removed the "man1" ....

Now all I need to do is locate the man pages for cpmac ... and I'll be a happy user.

---
--
osxpounder



[ Reply to This | # ]
Man Pages .. found!
Authored by: osxpounder on Jun 03, '03 05:23:57PM

Found that, too. I already had the man pages set right for cpmac, I just didn't have right command in mind: it's CpMac ...

Remember, OSX command-line newbies like me: capitalization counts. If you're used to old DOS, as I am, this can take some getting used to. If you spent lots of time at UNIX command lines, obviously this is not news to you.

---
--
osxpounder



[ Reply to This | # ]
osxutils needs developers
Authored by: sveinbjorn on Jun 02, '03 01:38:14PM

I'm the programmer of osxutils and I'm always looking for help in developing the tools since I can allocate very limited time to them under present circumstances. If you want to contribute patches, more tools, testing and bug reporting, etc, then get in touch.

I definitely don't recommend aliasing ls to lsmac since it is possible to break some functionality that way. In any case, the regular ls displays all sorts of useful information which lsmac does not, f.e. file permissions and data on symlinks.



[ Reply to This | # ]
Install a useful set of OS X specific command line apps
Authored by: gmackenz on Jun 02, '03 09:40:11PM

For lsmac, you can install via fink and worry not about missing man pages no more...

Never replace basic system necessary executables with non-standard ones. Definitely use something like lsm instead of linking ls to lsmac. I like the "-s" option as well. Did my lsm in .cshrc file in my user's home directory.

alias lsm 'lsmac -s'



[ Reply to This | # ]
Install a useful set of OS X specific command line apps
Authored by: bhines on Jun 03, '03 12:01:08AM

osxutils is now in fink, unstable tree if anyone would prefer to install it that way. (easier removal/upgrading)



[ Reply to This | # ]
Install a useful set of OS X specific command line apps
Authored by: carsten on Jun 03, '03 08:43:22PM
Note that the new "osxutils" in fink replaces the older "lsmac" package:
sudo fink install osxutils


[ Reply to This | # ]
Install a useful set of OS X specific command line apps
Authored by: kkling on Jun 10, '03 10:59:21AM

I am unable to install osxutils via fink. I get the error:

> no package found for "osxutils"
> Failed: no package found for specification 'osxutils'!

Any suggestions on how I can get fink to install this package?



[ Reply to This | # ]
Install a useful set of OS X specific command line apps
Authored by: kkling on Jun 12, '03 10:32:31AM

Found the instructions for installing specific packages from the fink unstable tree <http://fink.sourceforge.net/faq/usage-fink.php#unstable> from a link on Ben Hines pages . Thanks.



[ Reply to This | # ]
Where to find the man pages
Authored by: macubergeek on Jun 11, '03 09:35:53PM

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/osxutils/osxutils/man/



[ Reply to This | # ]
Developer Update
Authored by: sveinbjorn on Nov 01, '03 08:35:08PM

As of November 2, 2003, osxutils has a new tool called 'setlabel' which allows you to set Finder file labels, and 'lsmac' supports listing file labels.



[ Reply to This | # ]