当前位置:网站首页>出现Command ‘vim‘ is available in the following places,vim: command not found等解决方法
出现Command ‘vim‘ is available in the following places,vim: command not found等解决方法
2022-08-01 03:45:00 【码农研究僧】
1. 问题所示
本身vim是系统内置的命令,连vim都出现问题
出现如下问题:
[email protected]:/usr# vim ~/.bashrc
Command 'vim' is available in the following places
* /bin/vim
* /usr/bin/vim
The command could not be located because '/usr/bin:/bin' is not included in the PATH environment variable.
vim: command not found
截图如下:
2. 原理分析
内置命令无法识别,说明系统变量有误,导致无法识别,既然系统变量有误,将其注释或者更改为正确的即可,但是现在打不开,又怎么注释掉
2.1 方法一
通过上面的错误提示,使用/bin/vim或者 /usr/bin/vim 替换vim来打开编辑,打开之前错误的全局变量文件,发现变量有误,要么注释要么改为export PATH=/usr/local/mongodb/bin:$PATH
修改为正确的即可,之后还需要重启服务器,使用/sbin/reboot或者手动重启就可恢复原先的状态
2.2 方法二
本身linux 环境下
变量的改动具体有如下几种方式
vim /etc/profilevim /etc/bashrcvim ~/.bashrc~/.profile
系统变量有全局变量(通过命令行printenv 或者echo)和局部变量
知道全局环境变量被破坏,写入全局环境变量即可
在命令行输入
export PATH=/usr/bin:/usr/sbin:/bin:/sbin
# 或者
export PATH=/usr/bin:/bin
之后即可成功,通过即可查看命令是否有写入
对应通过vim 修改错误的变量文件,不然source也无法让配置文件生效
边栏推荐
猜你喜欢

The bigger and bigger the project is, I split it like this

故乡的素描画

TypeScript simplifies running ts-node

智芯传感输液泵压力传感器 为精准智能控制注入科技“强心剂”
![[Search topic] After reading the inevitable BFS solution to the shortest path problem](/img/f8/fbe906106dc8f7f7a6bd54d2dc3bc1.png)
[Search topic] After reading the inevitable BFS solution to the shortest path problem

opencv 缩小放大用哪种插值更好??

IDEA does not recognize the module (there is no blue square in the lower right corner of the module)

Summary of mobile page optimization in seconds

2022-07-31: Given a graph with n points and m directed edges, you can use magic to turn directed edges into undirected edges, such as directed edges from A to B, with a weight of 7.After casting the m

最新 955 不加班的公司名单
随机推荐
The fledgling Xiao Li's 113th blog project notes: Wisdom cloud smart flower watering device combat (2) - basic Demo implementation
普通用户无法访问hgfs目录
Compiled on unbutu with wiringPi library and run on Raspberry Pi
button remove black frame
TypeScript simplifies running ts-node
[FPGA tutorial case 43] Image case 3 - image sobel edge extraction through verilog, auxiliary verification through MATLAB
Elastic Stack的介绍
2. # 代码注释
The bigger and bigger the project is, I split it like this
如何下载Keil包
pdb药物综合数据库
win10 fixed local IP
Software Testing Weekly (Issue 82): In fact, all those who are entangled in making choices already have the answer in their hearts, and consultation is just to get the choice that they prefer.
ARM cross compilation
Summary of mobile page optimization in seconds
Which interpolation is better for opencv to zoom in and out??
HCIP(15)
怀念故乡的面条
Game Theory (Depu) and Sun Tzu's Art of War (42/100)
软件测试面试(三)