コンテンツにスキップ

Linux コマンド - 応用

少し踏み込んだ調査や整形で使う Linux コマンドをまとめる。

権限・所有者

chmod 644 file
chmod +x script.sh
chown user:group file

ネットワーク

ss -lntp
ip addr
ip route
curl -I https://example.com

テキスト処理

cut -d: -f1 /etc/passwd
sort file
uniq file
awk '{print $1}'
sed -n '1,20p' file

ログ・サービス

journalctl -u nginx
systemctl status nginx
systemctl restart nginx

メモ

  • 応用コマンドは単体で覚えるより、「調査パターン」とセットで覚えたほうが使いやすい