当前位置:网站首页>出现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也无法让配置文件生效
边栏推荐
- Nmap 操作手册 - 完整版
- Summary of mobile page optimization in seconds
- Valentine's Day Romantic 3D Photo Wall [with source code]
- MySQL3
- MLP neural network, GRNN neural network, SVM neural network and deep learning neural network compare and identify human health and non-health data
- 如何下载Keil包
- MySQL3
- leetcode6132. 使数组中所有元素都等于零(简单,周赛)
- Error using ts-node
- IJCAI2022 | Hybrid Probabilistic Reasoning with Algebraic and Logical Constraints
猜你喜欢

Make your Lottie support word wrapping in text fields

Introduction to the Elastic Stack

初出茅庐的小李第112篇博客项目笔记之机智云智能浇花器实战(1)-基础Demo实现

Input input box cursor automatically jumps to the last bug after the previous input

Interview Blitz 69: Is TCP Reliable?Why?

移动端页面秒开优化总结

普通用户无法访问hgfs目录

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

软件测试周刊(第82期):其实所有纠结做选择的人心里早就有了答案,咨询只是想得到内心所倾向的选择。

情人节浪漫3D照片墙【附源码】
随机推荐
纽约大学等 | TM-Vec:用于快速同源检测和比对的模版建模向量
Interview Blitz 69: Is TCP Reliable?Why?
2. # 代码注释
阿叶的目标
win10 固定本机IP
开源许可证 GPL、BSD、MIT、Mozilla、Apache和LGPL的区别
动态规划 01背包
【愚公系列】2022年07月 Go教学课程 025-递归函数
"Youth Pie 2": The new boyfriend stepped on two boats, and the relationship between Lin Miaomiao and Qian Sanyi warmed up
MySQL modifies SQL statements to optimize performance
What is dynamic programming and what is the knapsack problem
New York University et al | TM-Vec: Template Modeling Vectors for Rapid Homology Detection and Alignment
【愚公系列】2022年07月 Go教学课程 023-Go容器之列表
软件测试面试(三)
Introduction to Oracle
认真对待每一个时刻
By CSDN, torn
【搜索专题】看完必会的BFS解决最短路问题攻略
这个地图绘制工具太赞了,推荐~~
Four implementations of
batch insert: have you really got it?