Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jun 2002 22:20:40 -0700
From:      Adam Weinberger <monkey@crackula.com>
To:        Grant Cooper <grant.cooper@nucleus.com>
Cc:        questions@FreeBSD.ORG
Subject:   Re: rehash command
Message-ID:  <20020619222040.A23708@crackula.com>
In-Reply-To: <006601c2181e$74b1f3a0$7b6c6bd1@ab.hsia.telus.net>; from grant.cooper@nucleus.com on Wed, Jun 19, 2002 at 11:50:59PM -0600
References:  <F229AQDNIGtMA9Qmn9Z000138f3@hotmail.com> <006601c2181e$74b1f3a0$7b6c6bd1@ab.hsia.telus.net>

next in thread | previous in thread | raw e-mail | index | archive | help
grant -

the rehash command goes through all the directories in the PATH variable
and looks for every program that it can find. if you install a new
program, nmap for example, you can't just type in "nmap" and have the
program start. this is because the shell doesn't know where the command
"nmap" lives. once you issue a "rehash" command, then the shell will
know where the program lives, and can thus execute it.

so, you use rehash to tell the shell "look around for new programs."
this process takes about a second.

"which tcsh" tells you the full path to tcsh, namely /bin/tcsh on a
freebsd system.

the instructions that you have quoted are saying:

"to make sure that tcsh is installed correctly, type in 'rehash' to
make sure that the shell didn't miss where the program lives, and then
'which tcsh' to tell you exactly where that living space IS."

in other words: to call your local pizza place, first get the latest
phone book, and then look up the number for Dominos.

-Adam


Grant Cooper took 0.5K on Wed, Jun 19, 2002 at 11:50:59PM -0600 to say:
> 
> I did the "man rehash" to understand the term, but can someone help me out
> in english? I am a little confused still.
> How does rehash determine if your shell was installed. I did this command
> before and after and got the same results.
> 
> "Install the shell as a port or a package, just as you would any other port
> or package. Use rehash and which tcsh (assuming you are installing tcsh) to
> make sure it got installed."
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message


--
"I am disrespectful to dirt! Can you see I am serious!"
	-Mr. Sparkle
Adam Weinberger
monkey@crackula.com
http://www.crackula.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020619222040.A23708>