After i installed correctly jdk1.8.0 on my redhat distribution and restarted my computer, no linux command is found anymore! the last step i did in the installation of jdk1.8.0 was to write these variables in /etc/environment as it's mentionned in a link which by the way i followed to install jdk1.8.0 :
export JAVA_HOME=/opt/jdk1.8.0_121
export JRE_HOME=/opt/jdk1.8.0_121/jre
export PATH=$PATH:/opt/jdk1.8.0_121/bin:/opt/jdk1.8.0_121/jre/bin
when the day after i started my machine, i do "dir" or "ls" or "vi" or whatever else;
bash dir: command not found
bash vi: command not found
I read in the net that i've messed a path, but no solution is suggested. so how could i fix this problem ? Thank you for your help.
Related
when trying the example of the moq framework, I get the following exception when I enter "go generate":
example.go:5: running "moq": exec: "moq": executable file not found in $PATH
What should I do? I'm using Kubuntu 16.04
PS: I tried
export PATH=$PATH:/home/[...]/go/src/github.com/matryer/moq
without success
#sprabhakaran got the right answer. I only needed to add the go binary folder to the PATH global variable:
export PATH=$PATH:/home/[...]/go/bin
and if it doesn't work, check that moq was correctly installed.
First, install using the following command:
go install github.com/matryer/moq#latest
Go binary should be added to the global PATH
export PATH=$PATH:$HOME/go/bin
worked for me on MAC
I just installed sdkman for installing grails on my machine (MacOS). When I run which sdk command I don't get any output. But when I run the sdk help command the shell is able to resolve it and give the right output. I checked all the directories mentioned in $PATH environment variable but I could not find any executable sdk. So my question is how is shell able to resolve the sdk command?
Note: I also checked in Ubuntu and I see the same behavior.
As you mentioned correctly "sdk" is not a command, its a declared function created by sdkman-main.sh (in ~/.sdkman/src) once called from ~/.sdkman/bin/sdkman-init.sh
This is the reason why the installation page of sdkman asks for appending the following steps in the .bash_profile which declares this function each time the bash profile is loaded :
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
[[ -s "/home/dudette/.sdkman/bin/sdkman-init.sh" ]] && source "/home/dudette/.sdkman/bin/sdkman-init.sh"
This is also the reason "which" command doesn't pick it up as it checks for the installed commands on the linux PATH
OK. So I found it out. As #that-other-guy mentioned in the comment above, I used type -a instead of which, which showed me that it was a function defined.
I've installed Vagrant, Vagrant init worked fine. When I now run Vagrant up I get this error:
The executable 'cygpath' Vagrant is trying to run was not
found in the %PATH% variable. This is an error. Please verify
this software is installed and on the path.
Im using cygwin as terminal and I have windows 8, and I've placed C:\cygwin64\bin in my PATH in envoirment variables.
My question is, why do I get this error message when I've specified the path to my cygwin bin?
Thanks!
I am assuming you have Cygwin installed, simply add the path to cygwin (usually c:\cygwin\bin\cygwin.exe) to your shells %path% variable and you should be ready to go.
Ctrl-X => System => Advanced Settings => Variables
Restart your Powershell/Cmd-Window
I just experienced the same error after removing cygwin, and figured out that the answer is not in reinstalling it, but simply removing it from the %Path%, so that Vagrant wouldn't search for it when booting.
So, you can open Control Panel => System => Advanced System Settings => Environment Variables...
And then find Path under System Variables, and remove any references to cygwin.
Restart your shell, and you're good to go.
My soultion was to create a small wrapper script, vagrant.bat:
#setlocal
#set PATH=C:\HashiCorp\Vagrant\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
#vagrant %*
#endlocal
The vagrant.bat file is in a directory that is first in my PATH.
I suddenly had the same problem and found that for some reason Cygwin had been erased from the system (I was running from git bash shell). I reinstalled Cygwin and it then worked again.
I tried building my own linux distribution and I follow the Linux From Scratch book. When I tried entering the following commands in bashrc.
set +h
umask 022
LFS=/mnt/lfs
LC_ALL=POSIX
PATH=/tools/bin:/bin:/usr/bin
export LFS LC_ALL PATH
After this when I restart the terminal. I am seeing only $ symbol. I thought that entry I made in bashrc is the problem. So, I reverted back it and restarted the system too. But, still am seeing the same problem. Also, the auto completion too not working. Please, help me to get rid of this.
Welcome to stackoverflow
You should set the 'PS1' variable. Search it
This is my PS1, for example:
\[\e]0;\u#\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[00;32m\]\u#\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
Sorry folks, I got my terminal back by reinstalling bash shell by executing the following command
sudo apt-get install --reinstall bash
I Installed Ubuntu 14-04 LTS. I tried to install software's using Terminal.Each time Software Installation successful but after installation it always diSlays one command which is '-System-Product-Name:~$ '.I applied many this like my computer name etc.But not yet success.
I am new in Linux platform.Anyone aware solution for the same please help me.Thanks In advance
Add the following line to .bashrc file in your /home/your-username folder
export PS1="\[\e[0;32m\]\u#\h:\e[m\] \[\e[1;34m\]\w$\e[0m "
execute the command
source .bashrc
Then read
http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html
System-Product-Name is the default hostname.
To change it, you can run sudo nano /etc/hostname, modify it with something like yourname-desktop