꾸준하게 기록하기
article thumbnail

프로세스 vs 바이너리

  • 코드 이미지 또는 바이너리: 실행파일
  • 실행 중인 프로그램: 프로세스
    • 가상 메모리 및 물리 메모리 정보
    • 시스템 리소스 관련 정보
    • 스케쥴링 단위

 

 

 

리눅스는 다양한 프로세스 실행 환경

- 리눅스는 기본적으로 다양한 프로세스가 실행됨

- 유닉스 철학: 여러 프로그램이 서로 유기적으로 각자의 일을 수행하면서 전체 시스템이 동작하도록 하는 모델

 

foreground process / background process

foreground process

: 쉘에서 해당 프로세스 실행을 명령한 후, 해당 프로세스 수행 종료까지 사용자가 다른 입력을 하지 못하는 프로세스

 

background process : 사용자 입력과 상관없이 실행되는 프로세스

- 쉘(shell)에서 해당 프로세스 실행시, 맨 뒤에 & 를 붙여줌

 

foreground process 제어하기 

  • [CTRL] + z : foreground 프로세스를 실행 중지 상태(suspend모드)로 변경
  • 맨 마지막 [CTRL] + z로 중지된 프로세스는 bg 명령으로 background 프로세스로 실행될 수 있음
  • jobs 명령어 : 백드라운드로 진행 또는 중지된 상태로 있는 프로세스를 보여줌
  • [CTRL] + c : 프로세스 작업 취소 (해당 프로세스는 완전히 종료)

 

프로세스 상태 확인 - ps 명령어

- 사용법 : ps [option(s)]

- option

- 데몬 프로세스(daemon process)

 : 사용자 모르게 시스템 관리를 위해 실행되는 프로세스로 보통 시스템이 부팅될 때 자동실행(예: ftpd, inetd 등)

 

- 주요 ps 출력 정보 확인

 

참고 사이트 : https://www.techonthenet.com/linux/commands/ps.php 

 

Linux: ps command

Linux: ps command This Linux tutorial explains how to use the Linux ps command with syntax and arguments. NAME ps - report a snapshot of the current processes. SYNOPSIS ps [options] DESCRIPTION ps displays information about a selection of the active proces

www.techonthenet.com

 

참고 사이트 : https://gist.github.com/apbarrero/6338709

 

Meaning of process state codes (C column) on `ps` output

Meaning of process state codes (C column) on `ps` output - process_state_codes.md

gist.github.com

 

프로세스 중지시키기

  • kill 명령어
    • 사용법
      1. kill % 작업 번호(job number)
      2. kill 프로세스 ID(pid)
      3. 작업 강제 종료 옵션 -9

 


정리 

1. foreground process / background process

2. process 제어하기 -&, [CTRL] + z, [CTRL] + c, jobs, bg, kill

3. 프로세스 상태 확인  -ps

 

 

제로베이스 컴퓨터 공학 전공자 따라잡기 강의 정리한 내용입니다.
728x90
profile

꾸준하게 기록하기

@:_:

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!