zoukankan      html  css  js  c++  java
  • macbook的终端中使用gnu的ls命令

    1、首先,我用的是iterm2终端。方法是:到iterm2.com中下载后,复制到applications文件夹下,就可以了。

    2、其次,mac下的ls不是gnu的ls,两者是有区别的,看来开源世界还是对apple有看法的哦。

    3、再次,利用brew安装gnu的coreutils包,brew install coreutils

    4、注意,安装完后,如果要使用gnu的命令,要在前面加一个'g',比如ls命令要用gls,下面的是gnu原文:

    All commands have been installed with the prefix 'g'.
    
    If you really need to use these commands with their normal names, you
    can add a "gnubin" directory to your PATH from your bashrc like:
    
        PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
    
    Additionally, you can access their man pages with normal names if you add
    the "gnuman" directory to your MANPATH from your bashrc as well:
      1 # System-wide .profile for sh(1)
      2
      1 # System-wide .profile for sh(1)
    
        MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"

    5、如果想直接使用gnu的命令,可以修改path环境变量,这样写:

    PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"

    可以在改变前后,使用“ls --version"来查看使用的那个ls命令。

    6、gnu下的 ls --color=auto 命令,其实是根据两个文件来显示颜色的, /etc/DIR_COLORS 或者 ~/.dir_colors, 一个是系统级别的配置文件,一个用户级别的配置文件.所以,将ubuntu下的对应文件拷贝过来,就ok了,复制一个ubuntu的colors:

  • 相关阅读:
    docker安装kibana
    docker 安装elasticsearch
    redis常用命令
    判断CheckBox,select是否被选中
    里面的div怎么撑开外面的div,让高度自适应
    超链接,表单jquery提交方式
    SSM框架的sql中参数注入(#和$的区别)
    springmvc接收值的方式
    mysql语法顺序
    js创建对象并赋值其属性
  • 原文地址:https://www.cnblogs.com/litifeng/p/7497868.html
Copyright © 2011-2022 走看看