본문 바로가기

Linux27

linux chown chmod (setuid, setgid, sticky bit, mode format) 사용법, 설명, 차이 사용하는 이유 파일의 소유주를 변경하기위해 파일의 권한을 변경하기 위해 배경지식 - linux의 파일 정보 16bit file의 종류는 16bit 중 4bit로 표현하고, file의 권한은 16bit 중 12bit로 표현된다. - 3bit는 특수권한(setuid, setguid, sticky bit) - 3bit는 user(owner) 권한 - 3bit는 group 권한 - 3bit는 other(owner나 group이 아닌 user) 권한을 위해 존재한다. (16 = 4 + 3*4) chown 사용법 chown chown : chown root /u # /u 디렉터리의 owner를 root로 chown root:staff /u # /u 디렉터리의 owner를 root로 group을 staff로 chow.. 2022. 10. 21.
linux mkdir 사용법, 설명 사용하는 이유 디렉터리를 만들기 위해 mkdir 사용법 mkdir mkdir -p # 기본적으로 현재 working directory 가 parrent directory 가 된다 mkdir -m # file mode는 chmod처럼 하면 된다 linux man page 설명 mkdir - make directories Create the DIRECTORY(ies), if they do not already exist. (해석) mkdir - 디렉터리를 만듭니다 디렉터리들을 만듭니다(아직 존재하지 않는 경우에) 출처: mkdir(1): make directories - Linux man page mkdir(1) - Linux man page Name mkdir - make directories Synops.. 2022. 10. 21.
linux cat tail head 사용법, 설명 사용하는 이유 파일의 내용을 출력하기 위해 cat 사용법 cat cat -n # 라인마다 몇 번째 line 인지 출력 cat ... tail 사용법 tail tail -n # 원하는 라인만큼 출력 (기본 마지막 10줄) tail ... head 사용법 head head -n # 원하는 라인만큼 출력 (기본 맨처음 10줄) head ... linux man page cat - concatenate files and print on the standard output tail - output the last part of files head - output the first part of files (해석) cat - 파일들을 연결하고 표준 출력으로 출력합니다 tail - 파일들의 마지막을 출력합니다 hea.. 2022. 10. 21.
linux man help info 차이 비교 다들 프로그램이나 커맨드를 위한 documentation system이지만 그 범위와 기능에 창이가 있다. 사용하는 이유 쉘 내장 명령어나 리눅스 명령어, GNU project program의 매뉴얼(manual)을 살펴보기 위해 배경 지식 Linux는 GNU project(공개 소프트웨어 프로젝트)의 일환으로 만들어진 Linux kernel에 기반을 둔 운영체제 계열이다. Bash도 GNU(GNU is Not UNIX) project의 일환으로 나온 셸(사용자와 kernel 사이의 인터페이스)이다. man man linux kernel에 기반을 둔 OS(예 : ubuntu, debian, red hat...)에서 공통적으로 쓸 수 있는 linux command를 위한 documentation syste.. 2022. 10. 21.
linux cd 사용법, man cd 가 없는 이유 사용하는 이유 현재 작업 디렉터리를 변경하기 위해 기본 사용법 cd cd . # 자기 자신으로 이동(의미 없음) cd .. # 부모 디렉터리로 이동 man cd page가 없는 이유? linux에서 man cd을 해보면 다음 에러가 뜨는 걸 볼 수 있다. No manual entry for cd 그리고는 이를 검색하니 stackoverflow에서 다음과 같은 글을 찾을 수 있었다. cd is not a command, it's built into your shell. (후략) -(https://stackoverflow.com/questions/41147818/no-man-page-for-the-cd-command)- cd is a builtin shell command. (후략) -(https://sta.. 2022. 10. 21.
linux pwd 현재 작업 디렉터리 출력 print working directory = p w d 사용하는 이유 현재 작업 디렉터리를 알기 위해 기본 사용법 pwd 현재 작업중인 디렉터리의 전체 경로를 출력한다. 출처 : pwd(1): print name of current/working directory - Linux man page pwd(1) - Linux man page Name pwd - print name of current/working directory Synopsis pwd [OPTION]... Description Print the full filename of the current working directory. -L, --logical use PWD from environment, even if it contains sy.. 2022. 10. 21.