Look for Mac OS X tips & shortcuts I learnt through hours of experimentation. My goal is to help you get the job done without having to go through the 'Googling' process.

Sunday, January 09, 2005

ether

Friday, July 09, 2004

How to add a new directory to the path in the unix terminal

If you see a message indicating command not found, make certain that the
directory is in your path by entering at the command line:

% echo $PATH

That command will generate output that looks something similar to:

/bin:usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/lib:.

Each directory in the path is separated from the other directories by a
colon. If you don't see an entry for /usr/local/bin listed in the
output, then you'll need to identify your specific shell to modify its
path.For example, lets add /usr/local/bin to the path. From the command
line, enter:

% echo $SHELL

If /bin/tcsh is output, then execute these commands:

% echo 'set path = ($path /usr/local/bin)' >> ~/.cshrc
% source ~/.cshrc

If /bin/bash is output from the echo $SHELL command then enter:

% echo 'PATH=$PATH:usr/local/bin' >> ~/.bash_profile
% source .bash_profile

When a shell is initially launched, it looks for a configuration file in
the home directory of the user that launched it. For tcsh this is the
.cshrc file, and for bash it's the .bash_profile file. Within that file
you can place several different types of configuration information,
initialize new variables, or modify existing variables that the shell
will use. We're interesting in modifying the $PATH variable.

As explained earlier, the $PATH variable is a colon delimited list of
directories that the shell will search through for a command when you
invoke that command from the shell. For instance, you know that ls will
list the current directories contents.

Here's how this happens. When you type ls and press enter, the shell
begins searching the directories specified in the $PATH variable (in the
order in which they're specified in the variable) for the ls command.
When it finds the ls command it stop searching and executes that command.

We need to modify the $PATH so that we can enter from the command line
and have the shell able to locate and run the binary. To accomplish
this, we need to append the directory to the $PATH. That appending is
what the first line in both cases accomplishes. Note that we said that
the configuration file is read when the shell initially starts so our
appending of the $PATH normally wouldn't take place until we launched a
new shell.

The source command lets us get around that by causing the shell to read
the specified configuration file at runtime. With those two commands
we've modified the $PATH -- from now on when we launch a shell it will
be able to find the command in /usr/local/bin -- and we've caused the
currently running shell to read its configuration file again. Now we can
proceed with the current shell able to find and run the binary.

(Source: Safari Online)

Wednesday, July 07, 2004

ssh from X11

I spent hours trying to login to my remote unix server, from my X11 terminal (Ibook G4). I piously followed the online tips to use xhost & set up the DISPLAY parameters all in vain. Finally I took time to read the ssh manual page where I found out that ssh takes care of this itself. Infact, we should NOT set up any display parameters.

Here is the tip.

Goal: Connect from my X11 terminal (bash) to a remote (tcsh) terminal such that I could run remote GUI apps on my display.

Steps:

1. ssh -X username@remoteserver
2. >>login
3. start using the remote terminal & your GUI apps will automatically be displayed on your display.