惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
人人都是产品经理
人人都是产品经理
Engineering at Meta
Engineering at Meta
小众软件
小众软件
I
InfoQ
有赞技术团队
有赞技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Martin Fowler
Martin Fowler
月光博客
月光博客
雷峰网
雷峰网
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
SegmentFault 最新的问题
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
V
Visual Studio Blog
博客园 - 叶小钗
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
GbyAI
GbyAI
P
Proofpoint News Feed
Apple Machine Learning Research
Apple Machine Learning Research

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Python Geliştiricileri İçin Temel Linux Komut Seti ve Uyg...
Vebende Akademi · 2026-06-18 · via DEV Community

Vebende Akademi

Temel Linux Komutları + Cron Job + Python Servis Çalıştırma + SSH (Production Minimum Rehber)

Bu doküman, Python geliştiren bir kişinin production ortamında Linux’u yönetebilmesi için gereken minimum çekirdek bilgi setini içerir. Amaç; sistem kurmak değil, sistemi yönetebilmek ve debug edebilmektir.


1. Linux Temel Komut Seti (Mutlak Minimum)

1.1 Sistem içinde gezinme

pwd

Bulunduğun dizini gösterir.

ls -la

Tüm dosyaları detaylı listeler.

cd /var/www
cd ~
cd ..

Dizin değiştirme komutları.


1.2 Dosya işlemleri

mkdir app
touch app.py
cp app.py app_backup.py
mv app.py /opt/app/
rm file.txt
rm -rf folder/

📌 Kritik not:

  • rm -rf üretim ortamında en riskli komuttur.

1.3 Dosya içeriği inceleme

cat file.txt
less file.txt
head -n 20 file.txt
tail -f file.txt

📌 Özellikle:

  • tail -f → canlı log izleme

1.4 Arama işlemleri

grep "ERROR" logs.txt
grep -r "config" .
find . -name "*.py"


1.5 Sistem durumu

top
ps aux
df -h
free -h


1.6 Süreç yönetimi

kill -9 PID

PID: process ID


2. SSH (Uzak Sunucuya Bağlanma)

SSH, Linux sistem yönetiminin temelidir.


2.1 SSH ile bağlanma

ssh root@SERVER_IP

Örnek:

ssh root@185.12.45.90


2.2 SSH key ile bağlanma (önerilen)

ssh -i key.pem root@SERVER_IP


2.3 Hetzner Cloud üzerinden SSH erişimi

Hetzner Cloud üzerinde oluşturulan bir server için süreç:

1. Server oluşturulur

  • Hetzner panelinden bir Cloud Instance açılır
  • Ubuntu/Debian image seçilir

2. Public IP alınır

Örnek:

167.235.45.12

3. SSH bağlantısı

ssh root@167.235.45.12

4. İlk giriş kontrolü

whoami
uname -a


3. Python Script’i Linux Servis Olarak Çalıştırma (systemd)

Production’da en doğru yöntem: systemd service


3.1 Servis dosyası oluşturma

sudo nano /etc/systemd/system/python-app.service


3.2 Servis tanımı

[Unit]
Description=Python Application Service
After=network.target

[Service]
ExecStart=/usr/bin/python3 /opt/app/app.py
WorkingDirectory=/opt/app
Restart=always
User=root

[Install]
WantedBy=multi-user.target


3.3 Servisi başlatma

sudo systemctl daemon-reload
sudo systemctl start python-app
sudo systemctl enable python-app


3.4 Servis durumu

sudo systemctl status python-app


3.5 Log kontrol

journalctl -u python-app -f


4. Cron Job (Zamanlanmış Görevler)

Cron, Linux’un en kritik otomasyon aracıdır.


4.1 Cron mantığı

* * * * * command
│ │ │ │ │
│ │ │ │ └── Gün (hafta)
│ │ │ └──── Ay
│ │ └────── Gün
│ └──────── Saat
└────────── Dakika


4.2 Cron açma

crontab -e


4.3 Örnek kullanım senaryoları

Her dakika çalıştırma

* * * * * /usr/bin/python3 /opt/app/task.py


Her 5 dakikada bir

*/5 * * * * /usr/bin/python3 /opt/app/task.py


Her gün saat 03:00 backup

0 3 * * * /usr/bin/python3 /opt/app/backup.py


Sistemi kontrol eden job

*/10 * * * * /usr/bin/python3 /opt/app/healthcheck.py


4.4 Cron log kontrol

grep CRON /var/log/syslog


5. Log Yönetimi (Production kritik)

tail -f /var/log/syslog
journalctl -f


6. Network ve Port Kontrol

ss -tulnp
netstat -tulnp

📌 Açık portları gösterir.


7. Servis ve Process Debug

ps aux | grep python
top
htop


8. Dosya transfer ve deploy

SCP ile gönderim

scp app.py root@SERVER_IP:/opt/app/


SSH üzerinden direkt işlem

ssh root@SERVER_IP "ls -la /opt/app"


9. Minimal Production Workflow (Gerçek Hayat)

Senaryo: Python servis deploy

1. Sunucuya bağlan

ssh root@SERVER_IP


2. Kodları yükle

scp -r project/ root@SERVER_IP:/opt/app/


3. Servisi başlat

systemctl restart python-app


4. Log izle

journalctl -u python-app -f


5. Cron ile otomasyon

crontab -e


10. Özet (Minimum Bilgi Haritası)

Bir Python geliştiricisi için Linux’ta olmazsa olmaz çekirdek set:

✔ Dosya yönetimi

  • ls, cd, cp, mv, rm

✔ Sistem kontrol

  • ps, top, kill, df, free

✔ Log ve debug

  • tail -f, journalctl, grep

✔ SSH erişim

  • ssh root@ip
  • scp

✔ Servis yönetimi

  • systemctl start/stop/status

✔ Cron job

  • crontab -e
  • zamanlama mantığı

Sonuç

Linux tarafında gerçek üretim becerisi:

“Komut bilmek” değil, sistemi uzaktan yönetebilmek ve otomasyonu kurabilmektir.

Bu 5 alanı (SSH + systemd + cron + log + process) bilen bir geliştirici artık production seviyesine çıkmış olur.