تخطَّ إلى المحتوى

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

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

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

Arch Linux

# Install from official repository
sudo pacman -S btop

# Install from AUR
yay -S btop-git

FreeBSD

# Install from ports
sudo pkg install btop

# Build from ports
cd /usr/ports/sysutils/btop
sudo make install clean

الاستخدام الأساسي

بدء 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

خيارات سطر الأوامر

# 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

التنقل في الواجهة

اختصارات لوحة المفاتيح

# 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

التحكم بالماوس

# 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

خيارات الإعدادات

# 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

المظاهر

# 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

الميزات المتقدمة

إدارة العمليات

# 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

مراقبة وحدة معالجة الرسومات (إن كانت مدعومة)

# 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

تحسين الأداء

إعدادات استخدام الموارد

# 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

المراقبة عن بعد

Would you like me to continue with the remaining sections?```bash

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 مقابل 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 مقابل 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 إمكانيات مراقبة النظام الحديثة مع واجهة بديهية لتحليل الأداء في الوقت الفعلي وإدارة العمليات.