Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

About the executable paths in CentOS or any Linux machine

Tags:

linux

vim

vi

centos

I have installed vim in my computer, and i see there are two executables in my OS, one is in /usr/local/bin and the other is in /usr/bin. I want to use the /usr/bin vim but, whenever I type vim it takes the /usr/local/bin which I don't want. So, inorder to set the PATH of vim as /usr/bin instead of /usr/local/bin. How can I do that? Because, the vim in the /usr/local/bin is not that great, I mean it acts like vi editor.

Thanks

like image 632
Invictus Avatar asked May 03 '26 16:05

Invictus


2 Answers

It depends on your shell. If you're using bash, you can put /usr/bin at the start of your PATH by adding the following to your ~/.bashrc file:

export PATH=/usr/bin:$PATH

Questions like these are better suited for unix.SE, by the way.

like image 145
Snowball Avatar answered May 06 '26 10:05

Snowball


Programs installed and maintained by your distribution's package manager go into /usr/bin; stuff in /usr/local/bin is for manually (compiled and) installed applications. I don't know how you got your Vim version there, but as it probably isn't updated automatically and you don't like it, just remove (or rename if you're timid) it:

$ sudo rm /usr/local/bin/vim

There may also be corresponding runtime files in /usr/local/share/vim; you can remove them as well, though they won't do any harm, just waste disk space.

like image 40
Ingo Karkat Avatar answered May 06 '26 08:05

Ingo Karkat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!