Can someone tell me the zsh command for vmstat ? Also is there any link that lists out all these zsh equivalents? I keep stumbling upon this problem all the time when I'm trying to do something. Thanks
vmstat is the same in both shells (and all shells), you probably just don't have your PATH set correctly.
The Fix:
In your bash terminal (just type bash to open the bash terminal) type: which vmstat, you should see a path return.
Now, append this to your PATH in your .zshrc file with:
OUTPUT="$(which vmstat)";echo "export PATH=\""${OUTPUT}":\$PATH\"" >> ~/.zshrc
Switch to zsh by typing: zsh
Now source your .zshrc with:
. ~/.zshrc
Your PATH should be corrected.
Optional:
If you have just switched to zsh and you had a simple .bashrc file, one thing you could do is move everything from your .bashrc to your .zshrc. Just run:
cat ~/.bashrc >> ~/.zshrc
This will append everything in your .bashrc to your .zshrc.
Now source your .zshrc with:
. ~/.zshrc
Your PATH should be corrected, but you may want to manually example your .zshrc file for redundancies.
Related
I've downloaded neovim 5.1 and made a symlink to it in .local/bin folder.
After that I've added it to $PATH through .bashrc and aliased to vim:
alias vim="nvim"
export PATH=$HOME/.local/bin:$PATH
If I use vim command from inside the wsl I successfully launch neovim 5.1. However if I instead try to launch vim from powershell (wsl vim) .bashrc is ignored and vim 8.1 is launched instead. How can I make Powershell to use .bashrc in interoperability mode?
wsl bash -ic vim
-i tells bash that the shell is interactive, which causes ~/.bashrc to be loaded.
-c cause the next argument to be executed as a command(s); it also causes the bash process to exit after command execution.
I'm on Windows 10 machine and I just installed VS-Code to use instead of Atom. I tried to use permanent alias in VS-Code Bash Terminal which I had created & was working fine in Hyper Terminal, but it doesn't work in VS-Code terminal. Why is that & How can I fix it ?
I have
alias mongod="/c/Program\ files/MongoDB/Server/4.0/bin/mongod.exe"
alias mongo="/c/Program\ Files/MongoDB/Server/4.0/bin/mongo.exe"
in my '.bash_profile' file
In VS-Code terminal, try and check your alias is still defined:
alias mongod
cd ~
more .bash_profile
You will then see if said alias is still there in that VSCode environment.
If it is: do a source ~/.bash_profile, and the alias should be operational.
see also "Why ~/.bash_profile is not getting sourced when opening a terminal?"
~/.bash_profile is only sourced by bash when started in interactive login mode.
When you open a terminal, the terminal starts bash in (non-login) interactive mode, which means it will source ~/.bashrc.
So in your case, move those alias definitions to ~/.bashrc.
I'm trying to develop using Eclipse/Maven on my Mac and while setting environment variables there is no .bash_profile. I do ls -a and still not there. I see a .bash_history and .bash_sessions. Where am I supposed to set my JAVA_HOME and PATH?
Thank you!
In your terminal:
touch ~/.bash_profile; open ~/.bash_profile
Then make your edits and save. This is generic so make sure your path is correct in the above example.
For anyone else stumbling up on this after Mac Catalina,
Starting CATALINA the default shell is zsh.
The profile file name for zsh is ~/.zprofile.
To setup bash as your default:
Open terminal
Goto preferences and choose "Shell opens with"
Click on "Command(complete path)" and type "/bin/bash" to start bash shell
On terminal, enter this command: chsh -s /bin/bash
This will change shell for the current user to bash.
After that, you can see .bash_profile on the root folder.
I am following a tutorial on the link https://github.com/birlrobotics/birl_baxter/wiki and I was told as folows:
Finally, after doing catkin_make, place the newly created ~/ros/indigo/catkin_ws/devel/setup.bash file inside .bashrc
cd ~
emacs .bashrc
source ~/ros/indigo/rbx_ws/devel/setup.bash
When I run the command emacs .bashrc the emacs editor opens but I am not sure what I am expected to do after that .
The tutorial asks you to open your .bashrc file with the extensible editor Emacs by executingemacs .bashrc. Then you are supposed to add the line source ~/ros/indigo/rbx_ws/devel/setup.bash at the end of the file.
Then you exit the editor Emacs with the key stroke "C-x C-c" meaning you press the Control/CTRL key, hold it and then press first the 'x' key and then the 'c' key. After this you continue the tutorial.
Otherwise you can just:
echo "source ~/ros/indigo/rbx_ws/devel/setup.bash" >> ~/.bashrc in your terminal without using the editor Emacs.
I'm using MongoDb 2.6.1 following the material from https://university.mongodb.com/ (great material by the way) but I am not being able to add to my path the mongo commands.
I've followed this guide http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/ and I modified my .bashrc like this
export PATH=/Users/jonathancaballero/bin/mongodb/mongodb_2.6.1/bin:$PATH
And there is indeed where the binaries are (checked using the finder directly)
So my question is why I am not able to use mongod from any location in my terminal?
Please put the PATH export into .bash_profile:
export PATH=/path/to/your/mongo/bin:$PATH
Edit: The reason to put it into .bash_profile is that this file will usually get executed when bash is started as a login shell while .bashrc usually is exectuted for interactive non-login-shells. What usually happens is that .bashrc gets sourced in .bash_profile. This does not seem to be the case here. On MacOS X when you start a Terminal, .bashrc does not get executed. God knows why, as the shell opened should be an interactive non-login shell and therefor should execute .bashrc.
Another, albeit more "intrusive" solution would be to add the following to .bash_profile.
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
For those who are interested in the details: take a look into the according sections of bash's manpage