Directory /proc

From 탱이의 잡동사니
Jump to navigation Jump to search

Overview

/proc 디렉토리 내용 정리.

Basic

/proc 디렉토리는 굉장히 특별한 가상 파일 시스템이다. 실제로 존재하는 파일들을 모아놓은 파일 시스템은 아니지만, 시스템적으로 굉장히 유용한 가상 파일들이 모여있는 특별한 디렉토리이다. 이 디렉토리를 참조하여 현재 작동중인 프로세스와 시스템의 상황과 여러가지 사용중인 리소스의 내용들을 확인할 수 있다.

/proc/acpi

전원 관리와 관련된 정보가 들어있는 디렉토리이다.

$ ls /proc/acpi/ -l
total 0
dr-xr-xr-x 3 root root 0 May 24 16:15 ac_adapter
dr-xr-xr-x 3 root root 0 May 24 16:15 battery
dr-xr-xr-x 3 root root 0 May 24 16:15 button
dr-xr-xr-x 2 root root 0 May 24 16:15 ibm
-rw-r--r-- 1 root root 0 May 24 16:15 wakeup

/proc/asound

/proc/buddyinfo

/proc/bus

/proc/cgroups

/proc/cmdline

/proc/consoles

/proc/cpuinfo

현재 작동중인 프로세서의 상세 정보가 들어있다.

$ cat /proc/cpuinfo

processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 60
model name	: Intel(R) Core(TM) i7-4702MQ CPU @ 2.20GHz
stepping	: 3
microcode	: 0x17
cpu MHz		: 800.000
cache size	: 6144 KB
physical id	: 0
siblings	: 8
core id		: 0
cpu cores	: 4
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts
 rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c
 rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid
bogomips	: 4390.16
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:

...

/proc/uptime

cat /proc/uptime 을 해보면 숫자가 다음과 같이 두개가 나온다.

$ cat /proc/uptime 
28047.65 174710.22

첫 번째 숫자는 시스템이 시작된지 흐른 시간이다. 즉, up time 을 초(second)로 나타낸 숫자이다.

그리고 두 번째 숫자는 idle 상태로 있은 시간이다. 즉, idle time 을 초(second)로 나타낸 숫자이다.

See also