home / skills / pluginagentmarketplace / custom-plugin-devops / linux

linux skill

/skills/linux

This skill helps you manage Linux systems effectively by guiding process, filesystem, permissions, and packaging tasks with practical commands.

npx playbooks add skill pluginagentmarketplace/custom-plugin-devops --skill linux

Review the files below or copy the command above to add this skill to your agents.

Files (7)
SKILL.md
3.3 KB
---
name: linux-fundamentals-skill
description: Complete Linux administration skill covering process management, filesystem, permissions, package management, users, bash scripting, and system monitoring.
sasmp_version: "1.3.0"
bonded_agent: 01-devops-fundamentals
bond_type: PRIMARY_BOND

parameters:
  - name: distro
    type: string
    required: false
    default: "ubuntu"
    validation: "^(ubuntu|debian|centos|rhel|fedora|arch)$"
  - name: operation
    type: string
    required: true
    enum: ["process", "filesystem", "permissions", "package", "user", "script", "monitor"]

retry_config:
  strategy: exponential_backoff
  initial_delay_ms: 1000
  max_retries: 3

observability:
  logging: structured
  metrics: enabled
---

# Linux Fundamentals Skill

## Overview
Master Linux system administration - the foundation of DevOps.

## Parameters
| Name | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| distro | string | No | ubuntu | Target distribution |
| operation | string | Yes | - | Operation category |

## Core Topics

### MANDATORY
- Process lifecycle and management (ps, top, kill)
- Filesystem hierarchy and operations
- File permissions (chmod, chown, ACLs)
- Package management (apt, yum, dnf)
- User and group administration
- Basic bash scripting

### OPTIONAL
- LVM and disk partitioning
- Systemd service management
- Log analysis with journalctl

### ADVANCED
- Kernel parameters and sysctl
- SELinux/AppArmor security
- Performance profiling

## Quick Reference

```bash
# Process Management
ps aux | grep [p]rocess          # Find process (avoid grep itself)
kill -15 PID                      # Graceful termination
kill -9 PID                       # Force kill (last resort)
pkill -f pattern                  # Kill by pattern
nohup command &                   # Background immune to hangup

# File Permissions
chmod 755 file                    # rwxr-xr-x
chmod u+x,g+r file               # Symbolic notation
chown -R user:group dir/         # Recursive ownership
setfacl -m u:user:rw file        # Set ACL

# Package Management (Debian/Ubuntu)
apt update && apt upgrade -y
apt install -y package
apt autoremove

# Package Management (RHEL/CentOS)
dnf update -y
dnf install package

# User Management
useradd -m -s /bin/bash user
usermod -aG sudo user
passwd user

# System Info
uname -a                          # Kernel info
cat /etc/os-release              # OS version
free -h                           # Memory usage
df -h                             # Disk usage
```

## Troubleshooting

### Common Failures
| Symptom | Root Cause | Solution |
|---------|------------|----------|
| Permission denied | Insufficient privileges | Use sudo or check ownership |
| Command not found | Package not installed | Install with apt/dnf |
| No space left | Disk full | Clean /var/log, docker prune |
| High load | CPU/IO bottleneck | Use top, iotop |

### Debug Checklist
1. Check permissions: `id`, `ls -la`
2. Check disk: `df -h`, `du -sh /*`
3. Check memory: `free -h`
4. Check logs: `journalctl -xe`

### Recovery Procedures

#### Out of Disk Space
1. Find large files: `du -sh /* | sort -rh | head`
2. Clean cache: `apt clean`
3. Rotate logs: `journalctl --vacuum-size=100M`

## Resources
- [Linux Journey](https://linuxjourney.com)
- [TLDR Pages](https://tldr.sh)

Overview

This skill teaches practical Linux system administration fundamentals for DevOps and infrastructure work. It covers process management, filesystem operations, permissions, package management, user administration, bash scripting, and system monitoring. The goal is to give hands-on commands, troubleshooting patterns, and recovery steps you can apply immediately.

How this skill works

The skill presents core command patterns and workflows for managing processes, filesystems, packages, users, and services across common distributions. It includes quick-reference commands, a troubleshooting checklist, and recovery procedures for typical failures like out-of-disk or permission errors. Optional and advanced topics expand into LVM, systemd, kernel tuning, and container-friendly cleanup techniques.

When to use it

  • Onboard new engineers to Linux administration basics
  • Perform daily server maintenance and package updates
  • Troubleshoot production incidents (disk, memory, permissions)
  • Write or review bash scripts and automation tasks
  • Prepare systems for CI/CD pipelines and deployments

Best practices

  • Always check distribution-specific package manager (apt vs dnf) before installing
  • Prefer graceful process termination (SIGTERM) before using SIGKILL
  • Use sudo and least-privilege accounts; verify with id and ls -la
  • Keep regular backups and monitor disk usage to avoid out-of-space failures
  • Automate repetitive tasks with small, tested bash scripts and version them in source control

Example use cases

  • Find and stop a runaway process using ps, top, kill, or pkill
  • Fix permission errors by checking ownership and applying chmod/chown or ACLs
  • Update and patch servers: apt update && apt upgrade -y or dnf update -y
  • Recover from full disk: find large files with du, clean caches and vacuum journalctl
  • Add a user and grant sudo: useradd -m -s /bin/bash user; usermod -aG sudo user

FAQ

Which distro should I target when following examples?

Commands are shown for common families: Debian/Ubuntu (apt) and RHEL/CentOS (dnf). Adjust package manager and paths as needed for your distro.

When should I use ACLs versus chmod/chown?

Use chmod/chown for standard owner/group permissions. Use ACLs when you need fine-grained access for multiple users without changing ownership.