Linux alias uses

Source: Internet
Author: User
Tags python mysql virtual environment

To install some software python mysql jdk, you need to add environment variables, a path is added to the environment variable, you can directly enter the XX command in the Linux console.

Otherwise, do not add environment variables, using XX will be prompted to find the command, you need to jump to that directory. then execute the./xx, or every time you play the full path/root/dir1/dir2/dir3/dir4/xx , too long there is a lot of wood trouble.

The simple point is to add an environment variable, or you can use an alias.

The environment variable is the python under Miniconda3, which is python3, if you use Py2, you can source activate Py27 (here Py27 represents a Conda virtual environment name), and then you can Python It's helloworld.py.

You can also use aliases alias py27= '/root/miniconda3/envs/py27/bin/python ' so that you can py27 helloworld.py. The Python environment variables in the environment are still python3.6 and not mutually affected.

Because my miniconda3 below is 3.6, but I often use the python2.7 below, the bin directory has UWSGI supervisor these things, do not want to play a long path, you use alias alias

Alias py27= '/root/miniconda3/envs/py27/bin/python '
Alias supervisord= '/root/miniconda3/envs/py27/bin/supervisord '
Alias supervisorctl= '/root/miniconda3/envs/py27/bin/supervisorctl '

This allows you to use the Supervisord command directly, even if the/root/miniconda3/envs/py27/bin is not an environment variable.

Say so much where to change, Vim/etc/profile, VIM/ETC/BASHRC, Global

Vim ~/.BASHRC for a user.

Alias is the simplification of a long list of commands into a short command. Solve the problem of environment variable to some extent.

Linux alias uses

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.