개발자 미니민의 개발스터디

[생활코딩 : 리눅스] 간단한 디렉토리 구조 / 권한

by mini_min

디렉토리 구조 (간단하게 참고하면 좋다!)

/bin : Common linux commands 를 저장. all the users of the system are located here.

/sbin : System Binaries. system aministrator 가 사용하는 프로그램들이 위치해있음

/etc : Configuration Files. contains configuration files required by all programs. also contains startup, shutdown shell scripts.

/tmp : Temporary Files. this directory are deleted.

/home : for all users to store their personal files.

/opt : Optional add-on Applications. opt stands for optional.

/usr : User programs. /usr/bin contains binary files for user programs. /usr/bin contains libraries for /usr/bin and /usr/sbin.

 

echo $PATH : PATH 정보를 출력해준다. 

ls 명령어가 실행될 수 있는 이유는, PATH 라는 변수에 담긴 디렉토리 정보를 타고 들어가기 때문이다. (PATH 를 임의로 설정할 수도 있다. 자바/톰캣 설치했을 때 변경해줬던 적이 있었다.) $PATH 와 같은 변수 환경 변수라고 한다.

 


권한

파일 또는 디렉토리에 대해 유저가 어떠한 일을 할 수 있게 해주거나, 할 수 없게 만드는 것이다. 

권한은 순서대로 Read, Write, Execute 를 지킨다. 

  1. [-]대쉬 : 파일
  2. rw-rw-r-- : 처음 rm=owner의 권한, rm=group의 권한, 모든 사람들의 권한
  3. owner , group
  4. 시간
  5. 파일명 ****

→ rw- : 읽고 쓰는 권한은 있지만, 실행 권한은 없다(-)

→ r-- : 읽는 권한은 있지만, 쓰기와 실행 권한은 없다 (--)

 

권한 변경은 chmod 를 사용한다. 

perm.tx 의 읽기 권한을 제거했다. (o-r) 권한 추가는 (o+r) 로 하면 된다.

o : others 를 의미한다.

u : 소유자 즉, 유저를 의미한다.

a : 모든 사용자에 대해 권한을 설정한다.

 

 

블로그의 정보

개발자 미니민의 개발로그

mini_min

활동하기