当前位置:网站首页>出现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也无法让配置文件生效
边栏推荐
- Flutter Tutorial 01 Configure the environment and run the demo program (tutorial includes source code)
- Basic Theoretical Knowledge of Software Testing - Use Cases
- 【uniCloud】云对象的应用与提升
- [kali-information collection] enumeration - DNS enumeration: DNSenum, fierce
- HIRO: Hierarchical Reinforcement Learning 】 【 Data - Efficient Hierarchical Reinforcement Learning
- Flink 1.13 (8) CDC
- [Getting Started Tutorial] Rollup Module Packager Integration
- 一个service层需要调用另两个service层获取数据,并组装成最后的数据,数据都是list,缓存如何设计?
- 785. Quick Sort
- Unknown Bounded Array
猜你喜欢

What is dynamic programming and what is the knapsack problem

Replacing the Raspberry Pi Kernel

怀念故乡的月亮
![[Message Notification] How about using the official account template message?](/img/4d/5b47722d1f5ec1cae73fc8d930a35d.jpg)
[Message Notification] How about using the official account template message?

软件测试面试(三)

The fledgling Xiao Li's 113th blog project notes: Wisdom cloud smart flower watering device combat (2) - basic Demo implementation

<JDBC> 批量插入 的四种实现方式:你真的get到了吗?

纽约大学等 | TM-Vec:用于快速同源检测和比对的模版建模向量

对无限debugger的一种处理方式

Simulation of Active anti-islanding-AFD Active Anti-islanding Model Based on Simulink
随机推荐
ICML2022 | Deep Dive into Permutation-Sensitive Graph Neural Networks
Make your Lottie support word wrapping in text fields
The fledgling Xiao Li's 114th blog project notes: Wisdom cloud intelligent flower watering device combat (3) - basic Demo implementation
情人节浪漫3D照片墙【附源码】
lambda
The bigger and bigger the project is, I split it like this
Input输入框光标在前输入后自动跳到最后面的bug
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?
[uniCloud] Application and Improvement of Cloud Objects
动态规划 01背包
IJCAI2022 | Hybrid Probabilistic Reasoning with Algebraic and Logical Constraints
被 CSDN,伤透了心
【愚公系列】2022年07月 Go教学课程 025-递归函数
2. # 代码注释
测试
Nmap manuals - the full version
win10 fixed local IP
"Youth Pie 2": The new boyfriend stepped on two boats, and the relationship between Lin Miaomiao and Qian Sanyi warmed up
纽约大学等 | TM-Vec:用于快速同源检测和比对的模版建模向量
让你的 Lottie 支持文字区域内自动换行