콘텐츠로 이동

btop - 현대적 리소스 모니터

btop은 프로세서, 메모리, 디스크, 네트워크, 프로세스의 사용량과 통계를 보여주는 현대적이고 크로스 플랫폼 리소스 모니터입니다. htop을 대체하기 위해 설계되었으며, 향상된 기능과 더 나은 시각적 표현을 제공합니다.

설치

Ubuntu/Debian

# Install from package manager (Ubuntu 22.04+)
sudo apt update
sudo apt install btop

# Install from snap
sudo snap install btop

# Build from source
sudo apt install build-essential git cmake
git clone https://github.com/aristocratos/btop.git
cd btop
make
sudo make install
```다음 명령어로 btop을 설치할 수 있습니다:
```bash
sudo apt update
sudo apt install btop

CentOS/RHEL/Fedora

# Fedora
sudo dnf install btop

# CentOS/RHEL (EPEL required)
sudo yum install epel-release
sudo yum install btop

# Build from source
sudo yum groupinstall "Development Tools"
sudo yum install git cmake gcc-c++
git clone https://github.com/aristocratos/btop.git
cd btop
make
sudo make install
```다음 명령어로 btop을 설치할 수 있습니다:
```bash
sudo dnf install btop

macOS

# Using Homebrew
brew install btop

# Using MacPorts
sudo port install btop

# Build from source
git clone https://github.com/aristocratos/btop.git
cd btop
make
sudo make install
```Homebrew를 사용하여 btop을 설치할 수 있습니다:
```bash
brew install btop

Arch Linux

# Install from official repository
sudo pacman -S btop

# Install from AUR
yay -S btop-git
```pacman을 사용하여 btop을 설치할 수 있습니다:
```bash
sudo pacman -S btop

FreeBSD

# Install from ports
sudo pkg install btop

# Build from ports
cd /usr/ports/sysutils/btop
sudo make install clean
```pkg를 사용하여 btop을 설치할 수 있습니다:
```bash
pkg install btop

기본 사용법

btop 시작하기

# Start btop with default settings
btop

# Start with specific theme
btop --theme Default

# Start in minimal mode
btop --minimal

# Start with specific update interval
btop --update 1000

# Start with debug logging
btop --debug
```터미널에서 다음 명령어를 입력하여 btop을 실행합니다:
```bash
btop

명령줄 옵션

# Display help
btop --help
btop -h

# Show version information
btop --version
btop -v

# Use specific configuration file
btop --config /path/to/config

# Start in low-color mode
btop --low-color

# Start with UTF-8 disabled
btop --no-unicode

# Start with specific log level
btop --loglevel INFO
```btop은 다음과 같은 명령줄 옵션을 지원합니다:
- `--help`: 도움말 정보 표시
- `--version`: 버전 정보 표시
- `--config`: 사용자 정의 구성 파일 경로 지정

## 인터페이스 탐색

### 키보드 단축키
```bash
# General Navigation
q, Ctrl+c, Esc    # Quit btop
h, F1             # Show help
+, -              # Add/remove boxes
Tab               # Toggle between CPU and memory graphs
Shift+Tab         # Reverse toggle

# Process Control
k                 # Kill selected process
t                 # Tree view toggle
r                 # Reverse sorting order
c                 # Toggle command/name display
delete            # Clear process search
/                 # Start process search
n                 # Next search result
N                 # Previous search result

# View Controls
m                 # Toggle memory unit (KB, MB, GB)
d                 # Toggle disk unit display
n                 # Toggle network unit display
y                 # Toggle sync mode
z                 # Toggle zero values
a                 # Toggle auto-scaling graphs
g                 # Toggle GPU stats (if available)

# Process Sorting
F5, s             # Sort by PID
F6, S             # Sort by program name
F7, c             # Sort by CPU usage
F8, m             # Sort by memory usage
  • F1: 도움말
  • F2: 설정
  • F3: 프로세스 검색
  • F4: 프로세스 필터
  • F5: 트리 모드 전환
  • Q 또는 Esc: 종료

마우스 제어

# Mouse Support (if enabled)
Mouse wheel       # Scroll process list
Left click        # Select process
Right click       # Process context menu
Double click      # Process details
  • 클릭: 프로세스 선택
  • 스크롤: 위아래 이동
  • 우클릭: 컨텍스트 메뉴 열기

구성

구성 파일 위치

# Linux
~/.config/btop/btop.conf

# macOS
~/Library/Application Support/btop/btop.conf

# Create default config
btop --create-config
```구성 파일은 일반적으로 다음 경로에 있습니다:
- Linux/macOS: `~/.config/btop/btop.conf`
- Windows: `%APPDATA%\btop\btop.conf`

### 구성 옵션
```ini
# btop.conf example configuration

# Color theme
color_theme = "Default"

# Update rate in milliseconds
update_ms = 2000

# Process sorting
proc_sorting = "cpu lazy"

# Process tree view
proc_tree = false

# Process command display
proc_colors = true
proc_gradient = true
proc_per_core = false

# CPU settings
show_cpu_freq = true
cpu_graph_upper = "total"
cpu_graph_lower = "total"
cpu_invert_lower = true
cpu_single_graph = false

# Memory settings
show_swap = true
swap_disk = true
show_disks = true
only_physical = true
use_fstab = true

# Network settings
net_download = 100
net_upload = 100
net_auto = true
net_sync = false
net_color_fixed = false

# Display settings
shown_boxes = "cpu mem net proc"
update_check = true
background_update = true
custom_cpu_name = ""
disks_filter = ""
mem_graphs = true
show_gpu_info = false

# Interface settings
vim_keys = false
rounded_corners = true
graph_symbol = "braille"
graph_symbol_cpu = "default"
graph_symbol_mem = "default"
graph_symbol_net = "default"
graph_symbol_proc = "default"
shown_boxes = "cpu mem net proc"
proc_left = false
cpu_bottom = false
show_uptime = true
check_temp = true
show_coretemp = true
temp_scale = "celsius"
show_cpu_freq = true
```구성 파일에서 다음과 같은 옵션을 설정할 수 있습니다:
- 색상 테마
- 업데이트 간격
- 표시할 센서
- 그래프 스타일

### 테마
```bash
# Available themes
Default
Default_light
Gruvbox_dark
Gruvbox_light
Monokai
Nord
Solarized_dark
Solarized_light
TTY

# Custom theme creation
mkdir -p ~/.config/btop/themes
cp /usr/share/btop/themes/Default.theme ~/.config/btop/themes/custom.theme
# Edit custom.theme with your colors
```btop은 여러 내장 테마를 제공하며, 사용자 정의 테마도 만들 수 있습니다.

## 고급 기능

### 프로세스 관리
```bash
# Process filtering and searching
/                 # Start search
Esc               # Clear search
Enter             # Confirm search

# Process tree view
t                 # Toggle tree view
+/-               # Expand/collapse tree nodes

# Process details
Enter             # Show detailed process info
i                 # Show process I/O stats
o                 # Show process open files
l                 # Show process limits
e                 # Show process environment
  • 프로세스 우선순위 변경
  • 프로세스 종료
  • 프로세스 세부 정보 보기

시스템 모니터링

# CPU monitoring
1-9               # Show individual CPU cores
0                 # Show all CPU cores combined
Ctrl+L            # Toggle CPU frequency display

# Memory monitoring
m                 # Cycle through memory units
Shift+M           # Toggle memory graph type

# Disk monitoring
d                 # Toggle disk usage display
Shift+D           # Toggle disk I/O stats

# Network monitoring
n                 # Toggle network interface display
Shift+N           # Toggle network graph type
  • CPU 사용량
  • 메모리 사용량
  • 디스크 I/O
  • 네트워크 트래픽

GPU 모니터링 (지원되는 경우)

# GPU stats (NVIDIA/AMD)
g                 # Toggle GPU information
Shift+G           # Cycle GPU display modes

# GPU configuration in btop.conf
show_gpu_info = true
gpu_mirror_graph = true
check_gpu = true
```NVIDIA 및 AMD GPU의 사용량과 온도 모니터링

## 성능 최적화

### 리소스 사용 설정
```ini
# Reduce update frequency for lower CPU usage
update_ms = 5000

# Disable expensive features
proc_tree = false
show_disks = false
check_temp = false
background_update = false

# Simplify display
graph_symbol = "block"
proc_gradient = false
rounded_corners = false
  • 업데이트 간격 조정
  • 표시되는 프로세스 수 제한
  • 배경 프로세스 필터링

메모리 최적화

# Run with minimal memory footprint
btop --minimal

# Disable background updates
btop --no-update

# Use simple graph symbols
# Set graph_symbol = "block" in config
  • 메모리 사용량 모니터링
  • 메모리 캐시 관리
  • 메모리 누수 감지

통합 및 자동화

btop으로 스크립팅

#!/bin/bash
# Monitor system and log high CPU processes

btop --batch --iter 1|grep -E "CPU|MEM" > system_stats.log

# Export configuration
btop --print-config > btop_backup.conf

# Automated monitoring
while true; do
    btop --batch --iter 1 --delay 60 >> monitoring.log
    sleep 60
done
  • 셸 스크립트에서 btop 출력 캡처
  • 시스템 모니터링 자동화
  • 로깅 및 알림 설정

원격 모니터링

# SSH with btop
ssh user@remote-host btop

# Screen/tmux session
screen -S monitoring btop
tmux new-session -d -s monitoring btop

# Watch mode for continuous monitoring
watch -n 5 'btop --batch --iter 1'
```### 로그 분석
```bash
# Capture btop output
btop --batch --iter 10 > system_snapshot.txt

# Parse CPU usage
btop --batch --iter 1|grep "CPU"|awk '\\\\{print $2\\\\}'

# Monitor specific process
btop --batch|grep "process_name"
```## 문제 해결

### 일반적인 문제들
```bash
# Permission issues
sudo btop                    # Run with elevated privileges

# Terminal compatibility
export TERM=xterm-256color   # Set terminal type
btop --no-unicode           # Disable Unicode characters
btop --low-color            # Use basic colors

# Performance issues
btop --minimal              # Minimal interface
btop --update 5000          # Slower updates
```### 디버그 모드
```bash
# Enable debug logging
btop --debug --loglevel DEBUG

# Check log files
tail -f ~/.config/btop/btop.log

# Test configuration
btop --config /dev/null     # Run without config
btop --create-config        # Recreate default config
```### 시스템 호환성
```bash
# Check system requirements
uname -a                    # System information
echo $TERM                  # Terminal type
locale                      # Locale settings

# Test terminal capabilities
tput colors                 # Color support
tput cols; tput lines      # Terminal dimensions
```## 다른 도구와의 비교

### btop vs htop
```bash
# btop advantages
- Modern C++ codebase
- Better visual design
- GPU monitoring support
- More detailed process information
- Cross-platform consistency
- Active development

# htop advantages
- Lower resource usage
- Wider distribution availability
- More mature and stable
- Simpler configuration
```### btop vs top
```bash
# btop advantages
- Interactive interface
- Real-time graphs
- Mouse support
- Process tree view
- Better process management
- Modern terminal features

# top advantages
- Universal availability
- Lower resource usage
- Scriptable output
- Minimal dependencies
```## 고급 구성 예시

### 사용자 정의 색상 스키마
```ini
# Custom theme file: ~/.config/btop/themes/custom.theme
theme[main_bg]="#1e1e2e"
theme[main_fg]="#cdd6f4"
theme[title]="#f38ba8"
theme[hi_fg]="#89b4fa"
theme[selected_bg]="#45475a"
theme[selected_fg]="#cdd6f4"
theme[inactive_fg]="#6c7086"
theme[graph_text]="#f9e2af"
theme[meter_bg]="#313244"
theme[proc_misc]="#f5c2e7"
theme[cpu_box]="#89b4fa"
theme[mem_box]="#a6e3a1"
theme[net_box]="#fab387"
theme[proc_box]="#f38ba8"
theme[div_line]="#6c7086"
theme[temp_start]="#a6e3a1"
theme[temp_mid]="#f9e2af"
theme[temp_end]="#f38ba8"
theme[cpu_start]="#89b4fa"
theme[cpu_mid]="#cba6f7"
theme[cpu_end]="#f38ba8"
theme[free_start]="#a6e3a1"
theme[free_mid]="#f9e2af"
theme[free_end]="#f38ba8"
theme[cached_start]="#89b4fa"
theme[cached_mid]="#cba6f7"
theme[cached_end]="#f38ba8"
theme[available_start]="#a6e3a1"
theme[available_mid]="#f9e2af"
theme[available_end]="#f38ba8"
theme[used_start]="#f38ba8"
theme[used_mid]="#fab387"
theme[used_end]="#f9e2af"
theme[download_start]="#89b4fa"
theme[download_mid]="#cba6f7"
theme[download_end]="#f38ba8"
theme[upload_start]="#a6e3a1"
theme[upload_mid]="#f9e2af"
theme[upload_end]="#f38ba8"
theme[process_start]="#f38ba8"
theme[process_mid]="#fab387"
theme[process_end]="#f9e2af"
```### 성능 모니터링 설정
```ini
# High-performance monitoring configuration
update_ms = 1000
proc_sorting = "cpu lazy"
proc_tree = true
proc_colors = true
proc_gradient = true
show_cpu_freq = true
cpu_graph_upper = "total"
cpu_graph_lower = "total"
show_swap = true
show_disks = true
net_auto = true
shown_boxes = "cpu mem net proc"
graph_symbol = "braille"
rounded_corners = true
background_update = true
check_temp = true
show_uptime = true
``` 포괄적인 btop 치트시트는 설치, 구성, 사용법 및 고급 기능을 다룹니다. btop은 실시간 성능 분석 및 프로세스 관리를 위한 직관적인 인터페이스로 현대적인 시스템 모니터링 기능을 제공합니다.