يعد Linux ضروريًا للمطورين في عام 2026 – بدءًا من WSL2 على نظام التشغيل Windows وحتى نظام Unix لنظام التشغيل macOS وحتى الخوادم السحابية التي تعمل بنظام Ubuntu وAlpine. إن فهم Linux يجعلك مطورًا أفضل، ويمكّنك من العمل من جانب الخادم، وهو مطلوب لمعظم أدوار DevOps والواجهة الخلفية. يغطي هذا الدليل ما يحتاج كل مطور إلى معرفته حول Linux.
📋 Table of Contents
لماذا يعتبر Linux مهمًا للمطورين؟
- تعمل الخوادم بنظام Linux: 96% من أفضل مليون خادم ويب يعمل بنظام التشغيل Linux
- حاويات عامل الميناء: جميع صور الحاويات تقريبًا تعتمد على Linux
- الحوسبة السحابية: AWS EC2، GCP، Azure الافتراضي لمثيلات Linux
- أدوات التطوير: gcc، git، bash، curl جميعها أصلية على Linux
- WSL2: قم بتشغيل Linux على نظام التشغيل Windows دون التشغيل المزدوج
دليل توزيعات لينكس
| توزيعة | حالة الاستخدام | مدير الحزم |
|---|---|---|
| أوبونتو 24.04 إل تي إس | الخوادم، المبتدئين، WSL2 | apt |
| ديبيان | خوادم مستقرة، دون زخرفة | apt |
| جبال الألب لينكس | حاويات عامل ميناء (5 ميجابايت!) | apk |
| آرتش لينكس | التخصيص والتعلم | بكمن |
| تيار CentOS/RHEL | المؤسسة، والامتثال | dnf/yum |
معرفة Linux الأساسية للمطورين
هيكل نظام الملفات
# Key directories every developer should know
/ # root
/home/user/ # user home directory (~)
/etc/ # system configuration files
/var/log/ # log files
/var/lib/ # application data (databases, docker)
/opt/ # optional/third-party software
/usr/local/ # user-installed software
/tmp/ # temporary files (cleared on reboot)
/proc/ # virtual filesystem — kernel and process info
/dev/ # device files
# Navigation
cd ~ # go home
cd - # go back to previous directory
ls -la # list all with permissions
pwd # print working directory
find . -name "*.log" # find files
locate filename # fast find (uses index)
إدارة العمليات
# View processes
ps aux # all processes
ps aux | grep nginx # find nginx
top # interactive, real-time
htop # better interactive
pgrep -f "python" # find by name
# Kill processes
kill 1234 # graceful (SIGTERM)
kill -9 1234 # force kill (SIGKILL)
killall nginx # kill by name
pkill -f "python app.py" # kill by pattern
# Background jobs
./long_task.sh & # run in background
nohup ./task.sh & # persist after logout
jobs # list background jobs
fg %1 # bring job 1 to foreground
bg %1 # send to background
# System resources
free -h # memory usage
df -h # disk space
du -sh * # size of items in current dir
iostat -x 1 # I/O statistics
الشبكات للمطورين
# Check connectivity
ping google.com
traceroute google.com
dig google.com # DNS lookup
nslookup google.com
# Ports and services
ss -tulnp # list open ports + process
netstat -tulnp # same (older)
lsof -i :8000 # what's using port 8000
curl -I https://example.com # HTTP headers only
# SSH
ssh user@server.com
ssh -i ~/.ssh/key.pem ubuntu@ec2-host.compute.amazonaws.com
scp file.txt user@server:/path/to/dest/
rsync -avz ./src/ user@server:/app/src/
# SSH config (~/.ssh/config)
Host myserver
HostName 203.0.113.1
User ubuntu
IdentityFile ~/.ssh/mykey.pem
# Now: ssh myserver
systemd – إدارة الخدمة
# Managing services
sudo systemctl start nginx
sudo systemctl stop nginx
sudo systemctl restart nginx
sudo systemctl reload nginx # reload config without restart
sudo systemctl enable nginx # start on boot
sudo systemctl disable nginx
sudo systemctl status nginx
# View logs
journalctl -u nginx # nginx logs
journalctl -u nginx -f # follow nginx logs
journalctl -n 100 # last 100 system log entries
journalctl --since "1 hour ago"
# Create your own service
# /etc/systemd/system/myapp.service
[Unit]
Description=My App
After=network.target
[Service]
Type=simple
User=deploy
WorkingDirectory=/app
ExecStart=/usr/bin/python3 -m uvicorn main:app --host 0.0.0.0 --port 8000
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
وظائف كرون — المهام المجدولة
# Edit crontab
crontab -e
crontab -l # list current crons
# Cron syntax:
# MIN HOUR DAY MONTH WEEKDAY command
# 0 2 * * * /usr/bin/backup.sh
# Examples:
0 * * * * /app/hourly_task.sh # every hour
0 2 * * * /app/daily_backup.sh # 2am daily
*/15 * * * * /app/health_check.sh # every 15 min
0 9 * * 1-5 /app/weekday_report.sh # 9am Mon-Fri
0 0 1 * * /app/monthly_report.sh # 1st of month
# Logging cron output
0 2 * * * /app/backup.sh >> /var/log/backup.log 2>&1
Linux لـ Docker وCloud
# Docker on Linux
sudo apt install docker.io
sudo usermod -aG docker $USER # run docker without sudo
newgrp docker
# Docker-compose
sudo apt install docker-compose-plugin
docker compose up -d
# Cloud instances: most common tasks
# Connect
ssh -i key.pem ubuntu@your-server-ip
# Update and install
sudo apt update && sudo apt upgrade -y
sudo apt install -y nginx python3-pip git
# Firewall
sudo ufw enable
sudo ufw allow ssh
sudo ufw allow 80
sudo ufw allow 443
sudo ufw status
Linux للمطورين في 2026: إتقان سطر الأوامر (يغطي دليل أوامر Linux جميع الأوامر)، وفهم إدارة العمليات، وأدوات الشبكات، وخدمات النظام. إذا كنت تستخدم نظام التشغيل Windows، فإن WSL2 يمنحك Ubuntu مباشرةً في Windows Terminal – وهو أمر موصى به للغاية. المحطة هي المكان الذي تعيش فيه القوة الحقيقية لنظام التشغيل Linux، واستثمار الوقت هنا يؤتي ثماره طوال حياتك المهنية.
🔗 Share this article
✍️ Leave a Comment