BBEdit tells me it found 439 occurrences of “img src” in 317 files in the Markdown archives for dot unplanned, so this is starting to feel kind of doable. 122 of those occurrences are flickr images, only 27 use the ancient Movable Type 3 “click the thumbnail to pop up a window with the full image inside” markup, and 142 are consistently organized WordPress uploads I can manage with a little find-foo and a BBEdit text factory.
Hey … here are some things I learned to do, figured out or got around to:
ls in Mac:
You can do
ls -G in a Mac right now, without MacPorts or Homebrew installed, and you’ll get BSD-style colored output, which is to say “not as good as GNU-style colored output.” Directories, symlinks, and executables will be colored. That’s o.k. But I remembered back in Linux times where I could get things colored down to the file type. That’s what I prefer. I did some things one might reasonably do expecting to get that GNU-style output back on my Mac, missing a few key steps and badly aggravating myself, then stumbled across a missing piece last week while trying to figure out better bash prompts. So here’s what to do:
- Pick one of MacPorts or Homebrew. I do Homebrew, so the steps after this one should be read as vague guidance by MacPortists.
- Install the GNU coreutils package:
brew install coreutils
- Download this gist and save it to
- Make sure your new
~/.dir_colorsfile has a line in it that starts with “TERM” and then matches the output of the command
- Get this into your
~/.bash_profileor whatever it is you do*:
- Try it out in a directory full of different kinds of things:
Is it awesome for you? Hope so!
I also learned about a few more nice
ls options while I was mucking around, and now I include these in my
-F(classify): Which marks symlinks and directories with a
/respectively. Yes, they are also colored, but I like seeing the trailing
/after a directory.
--group-directories-first, which does what it says on the tin.
-h, for “human readable output” when displaying file sizes. I finally, after years of just typing it out, realized I never use
lswithout, so I canonicalized it. I eagerly await the first horrific misunderstanding that is going to cause me on some system that is not mine some day.
*Do I sort of hate the hall of mirrors that is
.profile? Boy, I sure do. Especially in the age of things like
rvm and whatever else quietly diddles what they think your shell’s init file oughta be to make whatever blood magic they’re up to work correctly. I thought “just switch to zsh” would fix that, but then you start getting into bizarre “oh, that doesn’t work with zsh during install” situations that make you realize you’re losing all the time you thought you’d get back with obscure little shell workflow optimizations trying to figure out why suddenly
which doesn’t work anymore.