当前位置:网站首页>出现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也无法让配置文件生效
边栏推荐
- One service layer needs to call the other two service layers to obtain data and assemble it into the final data. The data is all lists. How to design the cache?
- Simple and easy to use task queue - beanstalkd
- This map drawing tool is amazing, I recommend it~~
- 故乡的素描画
- Weekly Summary (*67): Why not dare to express an opinion
- Open source project site must-have & communication area function
- Software Testing Interview (3)
- win10 固定本机IP
- 在打开MYSQL表时,有的可以显示编辑,有的没有,如何设置。
- Hackers can how bad to what degree?
猜你喜欢

【kali-信息收集】枚举——DNS枚举:DNSenum、fierce

这个地图绘制工具太赞了,推荐~~

【uniCloud】云对象的应用与提升

The 16th day of the special assault version of the sword offer

leetcode6133. 分组的最大数量(中等)
![Invalid classes inferred from unique values of `y`. Expected: [0 1 2], got [1 2 3]](/img/53/3dc2233498db78b8480084ce496f0b.png)
Invalid classes inferred from unique values of `y`. Expected: [0 1 2], got [1 2 3]

Error using ts-node

The maximum quantity leetcode6133. Grouping (medium)

Compiled on unbutu with wiringPi library and run on Raspberry Pi

Ordinary users cannot access HGFS directory
随机推荐
Input input box cursor automatically jumps to the last bug after the previous input
简单易用的任务队列-beanstalkd
Ordinary users cannot access HGFS directory
Error using ts-node
剑指offer专项突击版第16天
情人节浪漫3D照片墙【附源码】
Difference Between Compiled and Interpreted Languages
leetcode6132. Make all elements in an array equal to zero (simple, weekly)
Basic Theoretical Knowledge of Software Testing - Use Cases
雪糕和轮胎
纽约大学等 | TM-Vec:用于快速同源检测和比对的模版建模向量
被 CSDN,伤透了心
Flutter "Hello world" program code
One service layer needs to call the other two service layers to obtain data and assemble it into the final data. The data is all lists. How to design the cache?
HCIP (14)
Raspberry pie arm version of GCC installed configuration and environment variables
"ArchSummit: The cry of the times, technical people can hear"
Game Theory (Depu) and Sun Tzu's Art of War (42/100)
【分层强化学习】HIRO:Data-Efficient Hierarchical Reinforcement Learning
Compiled on unbutu with wiringPi library and run on Raspberry Pi