How to check all versions of python installed on osx and centos

前端 未结 9 2105
予麋鹿
予麋鹿 2021-01-31 07:46

I just started setting up a centos server today and noticed that the default version of python on centos is set to 2.6.6. I want to use python 2.7 instead. I googled around and

9条回答
  •  眼角桃花
    2021-01-31 08:17

    Here is a cleaner way to show them (technically without symbolic links):

    ls -1 /usr/bin/python* | grep '[2-3].[0-9]$'
    

    Where grep filters the output of ls that that has that numeric pattern at the end ($).

    Or using find:

    find /usr/bin/python* ! -type l
    

    Which shows all the different (!) of symbolic link type (-type l).

提交回复
热议问题