ok, let's try a bit of a laterally shifted approach. I did think about it a bit, and we might not be so far apart. It's just that I do it this way for about 10 years now, and hardly even think about it anymore.
A finder window (presumably opening $HOME) and a Terminal window (also starting out in $HOME) show a different number of files and directories, which is inconsistent with each other. This problem gets even more pronounced as the 10.7 finder hides ~/Library, You could substitute other combinations here - Linux vs. BSD, KDE vs. Gnome, etc.
- what you would like (your requirement):
Finder and CLI tools should display a consistent picture, i.e. the files and directories displayed by default should be the same (and it's not just ls - every tool should be able to stick to that consistency). And let's broaden that requirement to not only one platform's tools, but multiple machines/OS versions.
A fine mess. Let me elaborate:
I essentially had this problem for the last 20-odd years. I'm working on most commercially available Unix systems, a number of Linux distros, some BSD flavors, Mac OS and Windows. Each of those OS has it's own idea where "My Stuff" is located by default, what is considered a "Desktop", etc. But, as a timesaver, I depend on my stuff beeing in the same place, every time. Some of it is kept in an SCM, other things are static. I don't want the OS to mess with it, and I want a consistent location.
While the Unix systems seem "close" as compared to Windows, they are not. And when two different releases of the same put stuff in the same directories, things break when you try to share $HOME between those two, or more.
These "platform pecularities" are pretty well entrenched, and a lot of things depend on such pecularities to run. You will usually find those oddities when you do something differently, not according to "mainstream" (i.e., one computer and obe vendors OS should be enough for you), and in some cases you can't even fix them (vendor code base). The number of problems is too much to handle when you try to leave the mainstream here, and it's pretty thankless to report bugs against that - they will mostly fail triage when compared to "real breakage". So the best answer you might get when you complain about such things is "don't do that, then".
My solution: I have a number of personal folders that live in the top level of what the "My Stuff" folder of that platform is considered to be, usually one level down from $HOME. On Mac OS, it's ~/Documents
shiny:Documents fl$ ls -1
current
done
ideen
keller
reference
src
trampolin
I adjust the platform to open default windows in there (Mac OS: Finder preferences, "New Finder windows open: Documents"). My shell profile changes to this directory, too. And because I'm boss in here, I say what goes in, and what's hidden. I basically ignore $HOME on the first level, because I consider the dot files (which I link to src//dotfiles in some cases) and everything else to be under "platform control". Some of it get copied up to $HOME, some of it linked. No hard rules, needs a platform dependent decision.
That way, I can let the OS mess around in $HOME, and even share a $HOME between machines with different OS flavors, or software versions (beta versions of KDE and GNOME, or rather anything beta, is pretty tame that way).
makes sense :-) ?
ls,awk,grepand their likes? – slhck May 30 '11 at 21:31lsso much I'm restricted in how to use it, then that's an option. – Daniel Beck May 31 '11 at 4:45hiddenattribute is also exposed viaxattr -p com.apple.FinderInfoat a different offset. I might write a totally newlsscript that does both colors and hidden flag ;) – Daniel Beck Jun 11 '11 at 6:30