LMuyi
V2EX  ›  macOS

求帮助谢谢,关于 macos 终端的。

  •  1
     
  •   LMuyi · Aug 23, 2018 · 2521 views
    This topic created in 2846 days ago, the information mentioned may be changed or developed.

    我之前装双版本 java,还是 python 相关东西的时候,照着步骤操作,结果导致了这样的遗留问题。 就是每次打开终端 都会提示: -bash: :wq: command not found 命令操作小白,查到了一个类似的案例,可是提问者的问题也没能解决。所以,没有搜到解决办法。 如有大佬可以帮一下忙,小弟在这里谢过了!嘿嘿。

    chengluyu
        1
    chengluyu  
       Aug 23, 2018
    :wq 是 vim 里的操作吧?你按图索骥肯定哪里遇到问题了。
    ywcjxf1515
        2
    ywcjxf1515  
       Aug 23, 2018 via iPhone
    不是大佬,试试谷歌搜“打开终端自动运行”。
    cattyhouse
        3
    cattyhouse  
       Aug 23, 2018 via iPhone
    cat ~/.bashrc

    cat ~/.bash_profile

    贴出里面的内容
    sinxccc
        4
    sinxccc  
       Aug 23, 2018
    你应该是之前编辑 ~/.bashrc ~/.profile ~/.bash_profile 这三个文件中的一个的时候不小心留下了 :wq 这一行。

    找到然后删掉就可以了。
    LMuyi
        5
    LMuyi  
    OP
       Aug 23, 2018
    ( 1 )终端输入 open -e .bash_profile
    (如果只是查看,直接使用 open .bash_profile )

    ( 2 )编辑

    ( 3 )关闭即可保存修
    解决啦!是上次在.bash_profile 文件里有 wq: 这样的东西,估计是没删除干净,删除保存退出后,好啦!
    LMuyi
        6
    LMuyi  
    OP
       Aug 23, 2018
    @sinxccc 对! 嘿嘿谢谢!
    LMuyi
        7
    LMuyi  
    OP
       Aug 23, 2018
    哈哈哈,大家这么热心帮忙!谢谢谢谢!!
    @cattyhouse
    @ywcjxf1515
    @chengluyu
    ClutchBear
        8
    ClutchBear  
       Aug 23, 2018
    用 vim 编辑的时候,
    忘了按 esc, 就输入了:wq 导致的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5214 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 60ms · UTC 05:52 · PVG 13:52 · LAX 22:52 · JFK 01:52
    ♥ Do have faith in what you're doing.