Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Search 'man' pages UNIX
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".]
  Post a comment  •  Comments (15)  
  • Currently 2.86 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (7 votes cast)
 
[14,840 views] Email Article To a Friend View Printable Version
Install RAR archive expansion tools UNIX
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).
  Post a comment  •  Comments (11)  
  • Currently 4.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[31,424 views] Email Article To a Friend View Printable Version
List all known commands UNIX
Probably this is old news, only I didn't know. For a list of all available commands in the terminal (tcsh), type Control-x Control-d.

[Editor's note: This is one of the default key bindings in the shell. You can see a list of all defined key bindings by typing bindkey at the prompt.]
  Post a comment  •  Comments (1)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[3,178 views] Email Article To a Friend View Printable Version
Play solitaire on XWindows UNIX
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:
/Users/Shared/pysol/pysol
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.]
  Post a comment  •  Comments (5)  
  • Currently 2.00 / 5
  You rated: 2 / 5 (1 vote cast)
 
[5,539 views] Email Article To a Friend View Printable Version
Stop top with a single keystroke UNIX
Instead of typing "control+c" to stop the 'top' display in the terminal, you can press the "q" key.

Simple.

[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.]
  Post a comment  •  Comments (2)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[1,830 views] Email Article To a Friend View Printable Version
Power backgrounding with 'screen' UNIX
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.
read more (284 words)   Post a comment  •  Comments (13)  
  • Currently 3.80 / 5
  You rated: 5 / 5 (5 votes cast)
 
[7,623 views] Email Article To a Friend View Printable Version
Create an exact copy of your system UNIX
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.]
  Post a comment  •  Comments (5)  
  • Currently 2.50 / 5
  You rated: 2 / 5 (4 votes cast)
 
[4,150 views] Email Article To a Friend View Printable Version
Change tcsh's default no match behavior UNIX
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:
set nonomatch
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?]
  Post a comment  •  Comments (9)  
  • Currently 3.20 / 5
  You rated: 3 / 5 (5 votes cast)
 
[7,279 views] Email Article To a Friend View Printable Version
French characters in Terminal UNIX
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.
  Post a comment  •  Comments (11)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[7,990 views] Email Article To a Friend View Printable Version
Auto-Reset root permissions UNIX
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.

Read on to see the script...
read more (40 words)   Post a comment  •  Comments (11)  
  • Currently 2.50 / 5
  You rated: 2 / 5 (4 votes cast)
 
[6,928 views] Email Article To a Friend View Printable Version