MCP HubMCP Hub
スキル一覧に戻る

Linux Bash

oriolrius
更新日 Yesterday
95 閲覧
1
1
1
GitHubで表示
その他general

について

このスキルは、Linuxのbashコマンド、シェルスクリプト、システム管理タスクに関する専門的なサポートを提供します。ファイル操作、プロセス管理、コマンドラインユーティリティの使用において、開発者を支援します。bashスクリプトの記述時や、コマンドラインからのLinuxシステム操作実行時にご利用ください。

クイックインストール

Claude Code

推奨
プラグインコマンド推奨
/plugin add https://github.com/oriolrius/pki-manager-web
Git クローン代替
git clone https://github.com/oriolrius/pki-manager-web.git ~/.claude/skills/Linux Bash

このコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします

ドキュメント

Linux Bash

Expert guidance for Linux bash operations, scripting, and system administration.

Core Commands

File Operations

  • ls -lah - List files with details, including hidden
  • find /path -name "pattern" - Find files by name
  • grep -r "pattern" /path - Recursive text search
  • chmod +x file - Make file executable
  • chown user:group file - Change ownership
  • tar -czf archive.tar.gz dir/ - Create compressed archive
  • tar -xzf archive.tar.gz - Extract archive

Process Management

  • ps aux | grep process - Find running processes
  • top / htop - Monitor system resources
  • kill -9 PID - Force kill process
  • nohup command & - Run command in background
  • jobs - List background jobs
  • fg %1 - Bring job to foreground

System Information

  • df -h - Disk usage human-readable
  • du -sh dir/ - Directory size
  • free -h - Memory usage
  • uname -a - System information
  • lsb_release -a - Distribution info

Text Processing

  • cat file | head -n 10 - First 10 lines
  • tail -f log.txt - Follow log file
  • sed 's/old/new/g' file - Replace text
  • awk '{print $1}' file - Print first column
  • sort file | uniq - Remove duplicates

Shell Scripting Best Practices

Script Template

#!/bin/bash
set -euo pipefail  # Exit on error, undefined vars, pipe failures

# Script description
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

main() {
    # Your logic here
    echo "Hello, World!"
}

main "$@"

Error Handling

# Check command success
if ! command -v tool &> /dev/null; then
    echo "Error: tool not found" >&2
    exit 1
fi

# Trap errors
trap 'echo "Error on line $LINENO"' ERR

Variables

# Constants (uppercase)
readonly CONFIG_FILE="/etc/app.conf"

# Variables (lowercase)
user_input="$1"

# Arrays
files=("file1.txt" "file2.txt")
for file in "${files[@]}"; do
    echo "$file"
done

Common Patterns

Check if file exists

if [[ -f "file.txt" ]]; then
    echo "File exists"
fi

Loop through files

for file in *.txt; do
    echo "Processing $file"
done

Read user input

read -p "Enter value: " user_value

Function definition

my_function() {
    local arg1="$1"
    echo "Received: $arg1"
}

Tips

  1. Quote variables: Always use "$variable" to prevent word splitting
  2. Use [[ ]] for tests: More features than [ ]
  3. Shellcheck: Use shellcheck script.sh to validate scripts
  4. Exit codes: Use $? to check last command status
  5. Debugging: Use set -x to trace execution

Safety First

  • Always test scripts in safe environment first
  • Use set -e to exit on errors
  • Validate input parameters
  • Quote file paths to handle spaces
  • Use absolute paths when possible

GitHub リポジトリ

oriolrius/pki-manager-web
パス: .claude/skills/linux-bash
certificate-authoritycertificate-managementcosmianfastifykmspki

関連スキル

algorithmic-art

メタ

This Claude Skill creates original algorithmic art using p5.js with seeded randomness and interactive parameters. It generates .md files for algorithmic philosophies, plus .html and .js files for interactive generative art implementations. Use it when developers need to create flow fields, particle systems, or other computational art while avoiding copyright issues.

スキルを見る

subagent-driven-development

開発

This skill executes implementation plans by dispatching a fresh subagent for each independent task, with code review between tasks. It enables fast iteration while maintaining quality gates through this review process. Use it when working on mostly independent tasks within the same session to ensure continuous progress with built-in quality checks.

スキルを見る

executing-plans

デザイン

Use the executing-plans skill when you have a complete implementation plan to execute in controlled batches with review checkpoints. It loads and critically reviews the plan, then executes tasks in small batches (default 3 tasks) while reporting progress between each batch for architect review. This ensures systematic implementation with built-in quality control checkpoints.

スキルを見る

cost-optimization

その他

This Claude Skill helps developers optimize cloud costs through resource rightsizing, tagging strategies, and spending analysis. It provides a framework for reducing cloud expenses and implementing cost governance across AWS, Azure, and GCP. Use it when you need to analyze infrastructure costs, right-size resources, or meet budget constraints.

スキルを見る