0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【保存版】Linux初心者が最初に覚えるべき systemctl コマンド完全ガイド

0
Posted at

😇 こんな人におすすめ

  • Linux触り始めた
  • サーバー操作が怖い
  • systemctlがよく分からない
  • LPIC受ける予定

🚨 結論:まずこれだけ覚えろ


systemctl start nginx
systemctl stop nginx
systemctl restart nginx
systemctl status nginx
systemctl enable nginx

👉 これで8割OK

📌 systemctlとは?

👉 サービス(サーバープログラム)を操作するコマンド

  • nginx(Webサーバー)
  • ssh(リモート接続)
  • cron(定期実行)

💡 サービスって何?

👉 バックグラウンドで動くプログラム

つまり

「気づかないところで動いてるやつ」


🔥 よく使うコマンド(超重要)

▶ 起動

sudo systemctl start nginx

▶ 停止

sudo systemctl stop nginx

▶ 再起動

sudo systemctl restart nginx

▶ 状態確認

systemctl status nginx

👉 一番使う


▶ 自動起動ON

systemctl enable nginx

▶ 自動起動OFF

systemctl disable nginx

⚠️ 初心者あるある

❌ nginx起動したのにアクセスできない

👉 原因

  • 起動してない
  • ポート開いてない
  • サービス死んでる

👉 まずこれ

systemctl status nginx

💻 実践(これやれば理解できる)


sudo apt install nginx
sudo systemctl start nginx
systemctl status nginx

👉 ブラウザで確認
http://localhost

🧠 LPICで狙われるポイント

  • start / stop / restart
  • enable / disable
  • status
  • systemdの理解

🔥 覚え方(チート)

👉 「スタストリスタエネ」

  • start
  • stop
  • restart
  • status
  • enable

🎯 まとめ

  • systemctl = サービス操作
  • status が最重要
  • enable で自動起動

💬 ひとこと

Linuxできる人は
👉 「サービス管理」ができる人です

ここ超えたら一気にレベル上がります。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?