[Linux]리눅스의 기본개념

공부기록·2023년 10월 19일
0
post-thumbnail

🔊 UNIX 구조


🔊 Login in


  • followed by our password
    • /etc/passwd
  • Shells
    • login하면 shell을 통한 명령어 입력이 가능해진다.
    • Command line interpreter
    • KornShell(/bin/ksh) : $

🔊 File and Directories


  • FileSystem
    • directory와 file은 계층구조를 갖는다.
    • 모든 file은 root(/)로 시작한다.
    • directory도 file로 간주된다.
  • Filename
    • filename에는 '/'과 null character가 포함되면 안된다.
    • directory 생성시 두개의 filename이 생성된다.
      • . : current directory, .. : parent directory
  • Pathname
    • absolute pathname : /usr/keith/file1
    • relative pathname : keith/file1
  • Working Directory
    • $ pwd : print working directory
  • Home Directory
    • log in하면 home directory에서 시작한다.
    • $ cd ~

🔊 Generalization of the file concept


  • 주변 장치와 communication channel 또한 file로 정의한다.
    • all I/O device : /dev/stdin, /dev/stdout, /dev/rmt0
	$ cat file > /dev/rmt0
  • Inter-Process Communication channels as a file
    • FIFO, PIPE, SOCKET

🔊 Unix File Types


  • Regular file
    • 이진수로 된 텍스트 파일이다.
  • Directory file
  • Character special and block special files
    • terminal과 disks
  • FIFO (named pipe)
    • interprocess communication
  • Socket
    • process간의 network communication을 위하여 사용하는 것입니다.
  • Ownership
    • 각 파일마다 owner가 다를 수 있다.
    • owner는 file의 권한을 설정할 수 있다.
  • Permission
    • 접근 권한
    • d : directory, l : sysbolic link, b : bolck special file, c : charcter file
      p : FIFO, - : regular file

🔊 Process


  • program을 실행하는 인스턴스
  • $ ps : process 관련 정보 출력
  • Inter-process communication (IPC)로는 PIPE, FIFO, signals, shared memory, semaphore, sockets이 존재한다.

🔊 System call


  • 실질적인 명령어의 처리는 Unix kernel에서 이루어진다.

  • 시스템콜 수행시 user -> kernel, kernel -> user하는 context switch가 발생하는데 실행시간이 길어지므로 과도한 호출은 자제하는 것이 좋다.

  • 모든 시스템콜은 header에 정의되어있고 필요없는 header 가져와도 괜찮다.

0개의 댓글

관련 채용 정보