bash-linux

Provides Bash command patterns, scripting templates, and error handling for Linux and macOS terminals.

2|Updated May 30, 2026
One-click install
npx skills add https://github.com/virahitvin8/crafty-gis --skill bash-linux-virahitvin8
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bash-linux
Source: https://github.com/virahitvin8/crafty-gis/tree/main/GIT_STAR/.agent/skills/bash-linux
Command: npx skills add https://github.com/virahitvin8/crafty-gis --skill bash-linux-virahitvin8

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working in Unix terminals requires remembering dozens of command syntaxes, operators, and scripting idioms, and mistakes like unquoted variables or missing error handling can break scripts or lose data. ## Core Features & Use Cases - Command Reference: Quick tables for file operations, process management, text processing with grep/sed/awk, networking with curl, and environment variables. - Script Template: A reusable Bash script skeleton with set -euo pipefail, colored logging functions, and a main entry point. - Error Handling Patterns: Trap-based cleanup, exit-on-error options, and common idioms like default values and command existence checks. - Use Case: When asked to kill a process occupying port 3000 or write a deployment script that fails safely, the AI applies the exact patterns from this reference instead of guessing syntax. ## Quick Start Use the bash-linux skill to write a script that finds all JavaScript files modified today and archives them into a tarball.

Frequently Asked Questions about bash-linux

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I kill a process running on a specific port in Linux?

Use lsof to find the process ID bound to the port, then kill it: kill -9 $(lsof -t -i :3000). You can also inspect it first with lsof -i :3000 to confirm which process owns the port.

How do I write a safe Bash script with error handling?

Start the script with set -euo pipefail so it exits on errors, undefined variables, and pipe failures. Add a trap cleanup EXIT handler to remove temporary files, and quote all variable expansions to prevent word splitting.

What is the difference between &&, ||, and ; in Bash?

The && operator runs the next command only if the previous one succeeded, || runs it only if the previous one failed, and ; runs commands sequentially regardless of exit status. Use && for dependent steps like npm install && npm run dev.

Can I use these Bash commands on Windows PowerShell?

No, this reference targets macOS and Linux only. PowerShell uses different commands like Get-ChildItem instead of ls, object-based pipelines instead of text-based ones, and $env:VAR syntax for environment variables.

How do I search for a pattern recursively in files using grep?

Use grep -rn "pattern" src/ to search recursively with line numbers, and add --include="*.js" to restrict the search to specific file types. Combine with sort and uniq for frequency counts of matches.