1.  chmod: Change access permissions, change mode. 

$chmod [option] [mode] [file]

*mode

symbolic 과 numeric mode가 있으나 symbolic이 사용하기 더 편함

- syntax: [ugoa] [[+-=][rwxXstugo]][...]

-r: read

-w: write

-x: execute

-X: execute only if the file is a directory

-s: set user or group ID on execution

* For more information, visit: https://ss64.com/bash/chmod.html

* example

$chmod a+x test: test 에 대한 execute permission을 모두에게 부여


2. PATH

executable file을 실행하려면 해당 파일이 있는 디렉토리에 가서 ./executable 로 실행하거나 linux의 PATH에 해당 디렉토리를 추가해 주어야 한다.


PATH란 무엇인가? linux에서 command line에 실행 명령이 들어왔을 때 executable을 찾는 위치이다.

(PATH is an environmental variable in Linux and other Unix-like operating systems that tells the shell which directories to search for executable files (i.e., ready-to-run programs) in response to commands issued by a user. It increases both the convenience and the safety of such operating systems and is widely considered to be the single most important environmental variable.[출처] http://www.linfo.org/path_env_var.html)


현재 자신의 PATH는 다음과 같이 확인해 볼 수 있다.

$echo $PATH


executable file을 PATH에 지정된 위치로 옮겨주는 것이 좋으나, ~/.profile 을 만들어 그 안에 PATH를 추가해 주어도 된다. 다음과 같은 line을 넣어주면 된다.

PATH = $PATH:$HOME/path/to/directory



+ Recent posts