IanB wrote:
Hi Thierry,
I can see you are whacking a few unix commands into a bash shell there but can you explain what they do for me?
Indeed! But I can't go to in detail on "how to" manage your Mac through a Unix shell. It's a bit of topic here. Anyways, here are some explanations on the commands themselves.
First I realize I've used one of my shell aliases 'll'. It's a command built in the Korn shell, that doesn't exists in Bash. So, I've created a convenient alias, that allows for some uniformity between the Unix shells I have to cope with.
alias ll='ls -alsG'
I've listed the content of the /Library/Receipts/db directory, which I'm allowed to read (and execute). This reports the presence of this file: a.receiptdb
That's it, it's what I'm looking for: the DataBase file MacOSX uses for many of its applications (thanks to a built-in SQL engine)
Apple provide a simple SQL client 'sqlite3' to manage and access these DB files. I prefer to provide the absolute path to this command to be sure I'll use the Apple provided binary and not some other 3rd party (or Darwin ports installed) version.
http://en.wikipedia.org/wiki/SQLite3
I use the 'vacuum' command that cleans and reorganize the DB file. This has for effect to optimize read accesses to the database
http://sqlite.org/lang_vacuum.html
You can excercise this 'sqlite3 vacuum' command onto your Mail Envelope Index file too. This makes Mail.app a tad bit faster browsing through your mails.
Finally, I've listed again the directory content to see how much space that file has freed on my HD. It means that my DB file needed some clean-up/reorg.
That command 'echo $((291647488 - 284282880))' is simply to use the math functions of the Bash shell I've used here as a simple calculator.
The receipts DB file is appended with information about installed packages. It's used by Repair Permissions (of Disk Utility) and Software Update. Both applications need to read the patterns defined by the applications designers to correctly apply the Unix permissions to each of the files installed/created by applications ... MacOSX system in first place.
I hope this will help.
Thierry