I've export PATH="~/.composer/vendor/bin/lumen"
in .bashrc
and .bash_profile
after export then lumen
command not working,
Rasel Khan:~$ lumen
lumen: command not found
But if command type ~/.composer/vendor/bin/lumen
in terminal then working, i want only when lumen
command type in terminal then exactly same as screenshot.
how can i fix this ?
see screenshot
Your problem will not be solved simply by unsetting PATH, as you'll still be left without a PATH that includes the necessary system directories. When you set your own PATH, in most cases you will want to append your new entry to the old PATH variable, not replace it entirely, as you have done.
Set your PATH variable back to the system default by typing
and then go edit your .bashrc and .bash_profile to have the correct entry, which will be something like
Notice the variable is set to begin with the existing $PATH. This way, you'll still have all the original system directories in your PATH, and your addition will be on the end. Also note that I removed lumen from the end of your example, because lumen is apparently the name of the binary you are trying to execute, and your PATH should include only directories containing binaries, not the binaries themselves.
Exec this to get your system default:
This error means you overwrite your default path with the added PATH vairable above.
How to restore the old PATH?
The default PATH variable is defined in /etc/environment.
To restore the default PATH first delete the add line
export PATH="~/.composer/vendor/bin/lumen"
from your.bashrc
Then save and source using command:
then delete from
.bash_profile
then save and source:Now source /etc/environment to restore the default path
Now your default PATH is restored, you can check by running
echo $PATH
Adding new path to PATH variable
Now to add a new PATH use:
EDIT: The error here raises because we add the binary itself so check the above line
Add the line to
.bashrc
then save and source:Check running
$PATH
you should see your new added path.the PATH stores all the places where the terminal looks for your applications/scripts etc... If you set the PATH to some "unfriendly" directory, the system will not be able to find /bin/sudo and others. You will have to type the whole path like /bin/sudo. The best way to fix this is to open your bash_profile and insert this line: export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games I think changing the profile will work just after the next reboot, so do this and after that use the command
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
to fix it for the current session."Protip :D :D" if you want to check for your own programs in a directory "/home/username/foo/bin", just add this way to your PATH and you will be able to call the programs stored there just by their names
Hope it helps :)