• Linux操作问题拾遗


    1,ps: command not found

         这个问题是发生在Docker容器中发现的。原因是没有安装procps

       执行安装命令:apt-get update && apt-get install procps

    2,syntax error: "(" unexpected错误

         执行shell脚本的时候,报这个错误。网上找的三种方案,我的是第二种解决的。

       1,在脚本前写#!/bin/bash

          2,执行dpkg-reconfigure dash然后选No

          3,路径问题,网上找的例子:在Makefile中查到出问题的是make语句中的$(shell pwd)部分。后来发现代码目录的目录名中包含了括号!把目录改名,去掉名字中的括号,恢复正常。

        该问题摘自  https://www.cnblogs.com/chujian1120/p/5888472.html

    3,shell脚本执行错误 $' ':command not found

         原因:脚本是在window下编辑完成后上传到linux上执行的,win下的换行是回车符+换行符,也就是 ,而unix下是换行符 。linux下不识别 为回车符,所以导致每行的配置都多了个 ,因此是脚本编码的问题。

      解决方案:在linux上执行 dos2unix 脚本名,再次执行脚本,报错消失。

      如果没有dos2unix,需要执行安装命令:apt-get -y install dos2unix

      该问题摘自 https://www.cnblogs.com/anpengapple/p/5664235.html

    4,vim鼠标不能右键粘贴、跨系统复制粘贴

     用vim时,鼠标右键不能粘贴而是进入了visual模式。
    方法一:
    在普通模式下键入:set mouse-=a【不包括引号)】
    方法二:
    编辑 ~/.vimrc 文件,加入如下代码:

    if has('mouse')
        set mouse-=a endif

    方法一每次打开vim时都需要设置一次。
    方法二改了配置文件后,问题就解决了。

    set mouse=a【这个是用来开启鼠标功能的,a表示所有模式】

    vi的三种模式:命令模式,插入模式,可视模式.鼠标可以启动于各种模式中:
    The mouse can be enabled for different modes:
    n Normal mode
    v Visual mode
    i Insert mode
    c Command-line mode
    h all previous modes when editing a help file
    a all previous modes
    r for |hit-enter| and |more-prompt| prompt
    Normally you would enable the mouse in all four modes with:
    :set mouse=a
    When the mouse is not enabled, the GUI will still use the mouse for
    modeless selection. This doesn’t move the text cursor.

    所以配置文件中的set mouse=a启动了所有模式,这样就屏蔽了鼠标右健功能.
    ---------------------
    作者:foryouslgme
    来源:CSDN
    原文:https://blog.csdn.net/foryouslgme/article/details/52688285

    5,bash: ps: command not found

      apt-get update && apt-get install procps

  • 相关阅读:
    SQLyog远程连接Linux服务器错误2003解决
    Linux/UNIX系统编程手册 练习3.8
    概括
    Linux 命令
    句柄类
    带有C风格的 CLib库
    Linux 命令
    C++ 编程思想 第三章 3-2
    一.创建型模式 Prototype 模式
    一.创建型模式 Builder
  • 原文地址:https://www.cnblogs.com/caobw/p/10556652.html
Copyright © 2020-2023  润新知