How can I install a program and have it accessible as a command from any directory?
I want to install a program (specifically metasploit), and have it accessible from any directory in the terminal. I have it installed correctly, but I have to travel to the directory it is installed in to run it (by using ./msfconsole ). I want to be able to be in any directory and just run "msfconsole" and have metasploit run. How do I do this? I'm pretty sure that I have to copy the metasploit folder to the /opt/ directory? Maybe the /usr/bin/ directory? I am not sure, and any help would be appreciated. Thanks in advance!
Either symlink the Metasploit binaries to /usr/bin so they are in your path, or add the Metasploit directory to your PATH variable.
Edit .bash_profile of the user:
Edit: I guess MS3FGX's suggestion is better if you want all existing users and future users to have instant access to the program without having to modify their bash_profile individually.
step by step:
at the prompt type
wait till it finishes
once it shows you the path to "msfconsole"
ln -sf /path/to/msfconsole msfconsole
ln [OPTION]... [-T] TARGET LINK_NAME (1st form)
ln [OPTION]... TARGET (2nd form)
ln [OPTION]... TARGET... DIRECTORY (3rd form)
ln [OPTION]... -t DIRECTORY TARGET... (4th form)
that will place a symlink in /usr/bin/msfconsole pointing to >>>> /path/to/msfconsole
you can verify this happend by typing
ls -l in the /usr/bin directory
|All times are GMT -5. The time now is 11:09 PM.|