Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,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 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[10,432 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 whomever 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 Mon, Jun 2 2003 at 12:39PM PDT
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 Mon, Jun 2 2003 at 1:01PM PDT
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 Mon, Jun 2 2003 at 2:41PM PDT

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 Mon, Jun 2 2003 at 2:59PM PDT
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 Tue, Jun 3 2003 at 8:53AM PDT
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 Tue, Jun 3 2003 at 8:39PM PDT
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 Mon, Jun 2 2003 at 1:37PM PDT
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 Mon, Jun 2 2003 at 3:46PM PDT
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 Tue, Jun 3 2003 at 5:09PM PDT
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 Tue, Jun 3 2003 at 5:19PM PDT
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 Tue, Jun 3 2003 at 5:23PM PDT
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 Mon, Jun 2 2003 at 1:38PM PDT
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 Mon, Jun 2 2003 at 9:40PM PDT
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 Tue, Jun 3 2003 at 12:01AM PDT
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 Tue, Jun 3 2003 at 8:43PM PDT
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 Tue, Jun 10 2003 at 10:59AM PDT
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 Thu, Jun 12 2003 at 10:32AM PDT
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 Wed, Jun 11 2003 at 9:35PM PDT
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/osxutils/osxutils/man/

[ Reply to This | # ]
Developer Update
Authored by: sveinbjorn on Sat, Nov 1 2003 at 8:35PM PST
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 | # ]