- 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
'Programming' 카테고리의 다른 글
[linux] bash에서 계산하기, bash calculation (0) | 2017.08.04 |
---|---|
[linux] 간단한 vim조작법 (0) | 2017.08.04 |
[linux] bash ls 색상 바꾸기 (0) | 2017.08.04 |
[linux] ssh 서버 접속 및 scp로 파일 전송 (0) | 2017.08.04 |
[linux]파일 찾기 find (0) | 2017.08.03 |