본문 바로가기

Study/linux

내가 만든 프로그램을 터미널에서 명령어처럼 사용하기

방법은 두 가지

1. 환경변수에  프로그램을 등록하는 방법

2. 프로그램 자체를 path 폴더에 넣는 방법

 

 

 

환경변수에 프로그램 등록하기

$ export PATH=$PATH:/any/folder/you/want
$ echo $PATH    # PATH 확인하기
$ source ~/.bashrc

 

 

 

https://askubuntu.com/questions/500775/permanent-path-variable

 

Permanent PATH variable

How will I make this /media/De Soft/mongodb/bin PATH variable permanent? Everyone is saying "export PATH=$PATH:media/De\ Soft/mongodb/bin to your ~/.profile, or .bashrc, or .zshenv depending on your

askubuntu.com

https://docs.oracle.com/cd/E19062-01/sun.mgmt.ctr36/819-5418/gaznb/index.html

 

To Set PATH on Linux (Sun Management Center 3.6.1 Installation and Configuration Guide)

 

docs.oracle.com

https://smallbusiness.chron.com/modify-path-ubuntu-52030.html

 

How to Modify a Path in Ubuntu

Ubuntu Linux, as well as all other Linux distributions, uses the PATH variable to tell the operating system where to look for executable commands. Typically these commands are located in the /usr/sbin, usr/bin and /sbin, and /bin directories. Other command

smallbusiness.chron.com

 

 

프로그램 자체를 path폴더에 넣기

/usr/bin/ #여기에 프로그램 넣기

도커는 /usr/bin/docker에 shared library (application/x-sharedlib) 형식으로 들어가있다.