zoukankan      html  css  js  c++  java
  • Linux别名工具alias的使用

    偶然发现Linux支持自定义命令

    现在Linux环境上经常有多个python环境,但是python2马上要停止维护了,所以我想多使用python3,但是Linux上的python命令调用的是python3

    有两种方案

    1、在/usr/bin目录下生成新的软连接进行调用

    2、还有种方式就是通过alias别名工具将python命令更改默认调用python3

    具体实现如下:

    user@computer:~$ ls /usr/bin/python*
    /usr/bin/python              /usr/bin/python2-wsdump    /usr/bin/python3-jsonpatch    /usr/bin/python3.6m
    /usr/bin/python2             /usr/bin/python2.7         /usr/bin/python3-jsonpointer  /usr/bin/python3m                 /usr/bin/python2-jsonschema  /usr/bin/python3           /usr/bin/python3-jsonschema                                     /usr/bin/python2-pbr         /usr/bin/python3-jsondiff  /usr/bin/python3.6

    得到目录下的python3环境路径,通过alias命令将python命令调用的python2改为python3

    user@computer:~$ alias python="/usr/bin/python3"                                                                     
    user@computer:~$ python Python 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> exit()

    这样就比较简单的可以直接使用python命令来调用python3了

  • 相关阅读:
    angular2 + bootstrap +jquery 实例
    How to create a angular2 project process
    icheck 插件
    select2 下面的搜索框 无法输入问题
    datatabels buttons
    datatables 跳转到指定页
    text-overflow:ellipse;
    box-shadow
    CSS强制性换行
    mybatis与hibernate的不同
  • 原文地址:https://www.cnblogs.com/bestwei/p/11714740.html
Copyright © 2011-2022 走看看