I recently found out that when viewing a man page you (via "man [command]") you can search it by using forward-slash. ie, / beewee would find the first occurrence of "beewee" and by hitting "n" it's like "Find Again" and it finds the next one.
I also found out about hitting "?" to see all the cool options that are possible while viewing a man page.
[Editor's note: I had no idea ... and of course (and this time I swear I checked!) there's no mention of these features in "man man".]
I've been looking for a long time for a command line tool or sources or an application which can expand multiple rar archives on Mac OS X. And with a single google search, today I've found a Mac OS X port of unrar, unace and binchunker in a package called PC Tools for Mac OS X.
The tools are in a single package form, and the package installs them into /usr/bin. Then, just type from anywhere in the terminal:
% unrar e archive.rar % unace e archive.ace
And of course, it still works if you have multiple archives attached (.r00, .r01, r02...).
For binchunker, it will convert .bin/cue or .raw/.cue (made by any PC CD burning software) in .iso or .cdr (that can be burned with Toast).
I love to play a relaxing game of solitare but the only games I had ran on classic which I try not to use. Then I found Pysol Solitare. To run this, you need Python and several libs which can all be installed with fink. Note I could not get this to run with MacPython.
Just download the tar.bz2 move it to your home directory and gnutar it:
gnutar -xzvf pysol-4.80.tar.bz2
Move the pysol-4.80 folder to a handy place (I used Shared) and rename it pysol so you don't have to remember the version. You could leave it in your home folder but don't be a piggy as everyone will enjoy this.
At the terminal then type:
to run it. Enjoy!
[Editor's note: I have not tested this myself, but it looks like a nice Solitaire collection if you have XFree86 installed and running.]
Instead of typing "control+c" to stop the 'top' display in the terminal, you can press the "q" key.
[Editor's note: Whoops, see comments ... I thought this was undocumented, but clearly, I just can't read early in the morning! Thanks for the clarification, and I'll try my best to catch these in the future.]
One of my absolute favourite *nix-tools is screen. It allows me to start a lengthy and possibly talkative and interactive process and then detach from it at will. I can later attach to the process and then enter right into where it is at the moment.
You can install screen using fink (which has been discussed previously on macosxhints.com), or you can download the source and build it yourself from the screen home page on gnu.org.
Read the rest of the article for a theoretical example of how to use screen once it's installed.
Here's a shell script that clones an entire Mac OS X file structure from one location to another. Though not an original concept here on Mac OS X Hints, the script demonstrates a good assortment of shell scripting tricks that every OS X geek should get to know.
[Editor's note: We have published articles in the past that discussed cloning the system. This script looks to be another valid method of doing the same thing, so I felt it worthy of publishing on its own. I have not tried the script myself.]
tcsh will consider it an error if it can't find a file matching an expression, and instead of executing it, it will print [cmd]: No Match. This makes it difficult to do things like:
find . -name [Mm]ac*
which works in bash (I do that a lot on linux as bash is the default shell). It takes some effort to properly escape the bracketed area, and I normally don't want to quote everything.
Another example is when typing URLs - the ? is used as a separator and results in the same error. To change tcsh's behavior, simply type:
This will tell tcsh to NOT consider expressions with wildcards that don't match any file an error. Most apps will tell you if things are actually missing, but in the rest of the cases where the characters are intentional, it will work.
[Editor's note: I have not tried this myself, but I do have a question on it -- anyone know how to UNSET this option once you've set it?]
I was having a problem when I wanted to insert, in MySQL db, any french characters like "é" or "Ã " for exemple. The terminal was always giving me "??" instead. This was also true when connecting to my Linux/MySQL server using SSH. Keep getting those "??" when doing a SELECT FROM.
Simple fix: - Open Terminal app and go in Preferences. - In the Shell section, choose "ISO Latin 1" in the String Encoding menu.
Do you run sendmail, like to have a secure system or does it just plain annoy you that Apple's installer messes with the root permissions. If so, then here's a place to put the script which will save you having to remember to do it yourself.
The script /etc/daily, which runs as root automatically does some tasks each day. However, I'm loathed to mess with these scripts - it's really nasty to install stuff in global scripts, there should be some way to customize without hacking arround to much. Well, there is. /etc/daily checks for a script /etc/daily.local which doesn't exist by default. I'd suggest putting the following in that file (and ensuring it has appropriate permissions). This will keep your root directories permissions neat without much work.