Skills bash-linux
🐚

bash-linux

Safe

Master Bash and Linux Terminal Commands

Generate correct bash commands and scripts without memorization. Claude Code provides accurate patterns for file operations, process management, text processing, and error handling in Linux and macOS environments.

Supports: Claude Codex Code(CC)
🥉 72 Bronze
1

Download the skill ZIP

2

Upload in Claude

Go to Settings → Capabilities → Skills → Upload skill

3

Toggle on and start using

Test it

Using "bash-linux". How do I find all Python files and count them?

Expected outcome:

  • To find all Python files recursively:
  • find . -name '*.py' -type f
  •  
  • To count them:
  • find . -name '*.py' -type f | wc -l

Using "bash-linux". Show me a script that backs up a directory

Expected outcome:

  • Here's a backup script with error handling:
  •  
  • ```bash
  • #!/bin/bash
  • set -euo pipefail
  •  
  • SOURCE="$1"
  • BACKUP_DIR="$2"
  • TIMESTAMP=$(date +%Y%m%d_%H%M%S)
  •  
  • tar -czf "$BACKUP_DIR/backup_$TIMESTAMP.tar.gz" "$SOURCE"
  • echo "Backup completed: backup_$TIMESTAMP.tar.gz"
  • ```
  •  
  • Usage: ./backup.sh /path/to/source /path/to/backup/dir

Using "bash-linux". How do I check if a command succeeded?

Expected outcome:

  • You can check exit status with $?:
  •  
  • ```bash
  • if command; then
  • echo "Success"
  • else
  • echo "Failed with exit code $?"
  • fi
  •  
  • # Or use && for chaining
  • command && echo "Success" || echo "Failed"
  • ```

Security Audit

Safe
v1 • 2/25/2026

Static scanner detected 92 patterns flagged as potential security issues. After manual review, all findings are confirmed FALSE POSITIVES. The skill file is educational documentation containing bash command examples in markdown code blocks and tables. Backticks and command syntax are part of markdown formatting for documentation purposes, not executable code. No malicious intent detected, no security risks identified.

1
Files scanned
205
Lines analyzed
0
findings
1
Total audits
No security issues found
Audited by: claude

Quality Score

38
Architecture
100
Maintainability
87
Content
31
Community
100
Security
100
Spec Compliance

What You Can Build

Developer workflow automation

Software developers use this skill to automate repetitive tasks like file batch processing, log monitoring, and build pipelines. Reduces time spent searching for correct command syntax.

System administration scripting

DevOps engineers and sysadmins reference these patterns to write reliable bash scripts with proper error handling. Helps create maintainable automation scripts for server management.

Learning bash fundamentals

New users transitioning from Windows to Linux or macOS learn correct command patterns and understand bash scripting best practices. Provides quick reference without searching multiple documentation sources.

Try These Prompts

Basic file search command
How do I find all JavaScript files modified in the last 7 days?
Process management command
Show me the command to find and kill a process using port 3000
Script with error handling
Create a bash script template that handles errors properly and includes cleanup on exit
Text processing pipeline
How do I extract the second column from a CSV file and count unique values?

Best Practices

  • Always quote variables to prevent word splitting and glob expansion: use "$VAR" instead of $VAR
  • Use set -euo pipefail at the start of scripts to catch errors early and fail on undefined variables
  • Test destructive commands with echo first: replace rm with echo rm to see what would be deleted
  • Prefer [[ over [ for conditionals as it's safer and more portable in modern bash scripts

Avoid

  • Don't parse ls output - use find or glob patterns instead as ls output is not designed for parsing
  • Avoid eval on user input - it allows arbitrary code execution and is a major security vulnerability
  • Don't use cd in scripts without error checking - use absolute paths or subshells (cd ... || exit)
  • Avoid looping over ls output - use shell globbing (for file in *.txt) instead for reliable file iteration

Frequently Asked Questions

Why does my bash script fail when I copy commands directly?
Scripts run in a non-interactive shell without your aliases and PATH customizations. Always use full paths and test scripts with bash -x scriptname.sh to debug.
What's the difference between single quotes and double quotes?
Double quotes allow variable expansion and command substitution: "$VAR" expands to the value. Single quotes treat everything literally: '$VAR' stays as the literal string.
How do I handle spaces in filenames?
Always quote variables: use "$file" instead of $file. Use while IFS= read -r line for reading files, and find -print0 with xargs -0 for null-separated handling.
Why does my script say 'command not found'?
The command isn't in your PATH. Use the full path (/usr/bin/command) or add the directory to PATH: export PATH="$PATH:/new/path". Use command -v cmdname to check if a command exists.
What's the difference between && and ;?
The && operator runs the second command only if the first succeeds (exit code 0). The semicolon runs both commands regardless, continuing even if the first fails.
How do I debug a bash script?
Run with bash -x script.sh to print each command before execution. Add set -x in your script to enable debugging for specific sections. Use set -v to print lines as they're read.

Developer Details

File structure

📄 SKILL.md