Skip to content
cccskills
FreePublished on GitHub

bash-linux

Padrões de terminal Bash/Linux. Comandos críticos, piping, tratamento de erros, scripting. Use ao trabalhar em sistemas macOS ou Linux.

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md4.4 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Padrões Bash Linux

Padrões essenciais para Bash em Linux/macOS.


1. Sintaxe de Operadores

Encadeamento de Comandos

OperadorSignificadoExemplo
;Executar sequencialmentecmd1; cmd2
&&Executar se anterior sucedeunpm install && npm run dev
||Executar se anterior falhounpm test || echo "Tests failed"
|Pipe de saídals | grep ".js"

2. Operações com Arquivos

Comandos Essenciais

TarefaComando
Listar tudols -la
Encontrar arquivosfind . -name "*.js" -type f
Conteúdo do arquivocat file.txt
Primeiras N linhashead -n 20 file.txt
Últimas N linhastail -n 20 file.txt
Seguir logtail -f log.txt
Buscar em arquivosgrep -r "pattern" --include="*.js"
Tamanho do arquivodu -sh *
Uso de discodf -h

3. Gerenciamento de Processos

TarefaComando
Listar processosps aux
Encontrar por nomeps aux | grep node
Matar por PIDkill -9 <PID>
Encontrar usuário da portalsof -i :3000
Matar portakill -9 $(lsof -t -i :3000)
Backgroundnpm run dev &
Jobsjobs -l
Trazer para frentefg %1

4. Processamento de Texto

Ferramentas Principais

FerramentaPropósitoExemplo
grepBuscargrep -rn "TODO" src/
sedSubstituirsed -i 's/old/new/g' file.txt
awkExtrair colunasawk '{print $1}' file.txt
cutCortar camposcut -d',' -f1 data.csv
sortOrdenar linhassort -u file.txt
uniqLinhas únicassort file.txt | uniq -c
wcContarwc -l file.txt

5. Variáveis de Ambiente

TarefaComando
Ver todasenv ou printenv
Ver umaecho $PATH
Definir temporariamenteexport VAR="value"
Definir em scriptVAR="value" command
Adicionar ao PATHexport PATH="$PATH:/new/path"

6. Rede

TarefaComando
Downloadcurl -O https://example.com/file
Requisição APIcurl -X GET https://api.example.com
POST JSONcurl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' URL
Verificar portanc -zv localhost 3000
Informações de redeifconfig ou ip addr

7. Template de Script

#!/bin/bash
set -euo pipefail  # Exit on error, undefined var, pipe fail

# Colors (optional)
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'

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

# Functions
log_info() { echo -e "${GREEN}[INFO]${NC} $1"; }
log_error() { echo -e "${RED}[ERROR]${NC} $1" >&2; }

# Main
main() {
    log_info "Starting..."
    # Your logic here
    log_info "Done!"
}

main "$@"

8. Padrões Comuns

Verificar se comando existe

if command -v node &> /dev/null; then
    echo "Node is installed"
fi

Valor padrão de variável

NAME=${1:-"default_value"}

Ler arquivo linha por linha

while IFS= read -r line; do
    echo "$line"
done < file.txt

Loop sobre arquivos

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

9. Diferenças do PowerShell

TarefaPowerShellBash
Listar arquivosGet-ChildItemls -la
Encontrar arquivosGet-ChildItem -Recursefind . -type f
Ambiente$env:VAR$VAR
Concatenação string"$a$b""$a$b" (igual)
Verificar nuloif ($x)if [ -n "$x" ]
PipelineBaseado em objetoBaseado em texto

10. Tratamento de Erros

Definir opções

set -e          # Exit on error
set -u          # Exit on undefined variable
set -o pipefail # Exit on pipe failure
set -x          # Debug: print commands

Trap para limpeza

cleanup() {
    echo "Cleaning up..."
    rm -f /tmp/tempfile
}
trap cleanup EXIT

Lembre-se: Bash é baseado em texto. Use && para cadeias de sucesso, set -e para segurança, e sempre coloque aspas em suas variáveis!

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Especialista em construir experiências 3D para a web - Three.js, React Three Fiber, Spline, WebGL e cenas 3D interativas. Cobre configuradores de produtos, portfólios 3D, websites imersivos e adição de profundidade às experiências web. Use quando: website 3D, three.js, WebGL, react three fiber, experiência 3D.

The English summary is being prepared. Showing the original description.

artubss/SKILLS-CLAUDE-CODE11Updated May 17, 2026

Quando o usuário quer planejar, projetar ou implementar um teste A/B ou experimento. Também use quando o usuário menciona "teste A/B", "split test", "experimento", "testar essa mudança", "copy variante", "teste multivariado" ou "hipótese". Para implementação de rastreamento, veja analytics-tracking.

The English summary is being prepared. Showing the original description.

artubss/SKILLS-CLAUDE-CODE11Updated May 17, 2026

Auditar e melhorar a acessibilidade web seguindo as diretrizes WCAG 2.1. Use quando solicitado para "melhorar acessibilidade", "auditoria a11y", "conformidade WCAG", "suporte a leitor de tela", "navegação por teclado" ou "tornar acessível".

The English summary is being prepared. Showing the original description.

artubss/SKILLS-CLAUDE-CODE11Updated May 17, 2026

Testes e benchmarking de agentes LLM incluindo testes comportamentais, avaliação de capacidades, métricas de confiabilidade e monitoramento em produção—onde até os melhores agentes alcançam menos de 50% em benchmarks do mundo real. Use quando: testes de agentes, avaliação de agentes, benchmark de agentes, confiabilidade de agentes, teste de agentes.

The English summary is being prepared. Showing the original description.

artubss/SKILLS-CLAUDE-CODE11Updated May 17, 2026

Criar, gerenciar e orquestrar agentes de IA usando o CLI AI Maestro. Use quando o usuário pedir para "criar agente", "listar agentes", "deletar agente", "hibernar agente", "despertar agente", "instalar plugin", "mostrar agente", "reiniciar agente" ou qualquer tarefa de gerenciamento do ciclo de vida do agente.

The English summary is being prepared. Showing the original description.

artubss/SKILLS-CLAUDE-CODE11Updated May 17, 2026

Gerencie múltiplos agentes CLI locais via sessões tmux (iniciar/parar/monitorar/atribuir) com agendamento compatível com cron.

The English summary is being prepared. Showing the original description.

artubss/SKILLS-CLAUDE-CODE11Updated May 17, 2026

See all skills by artubss

Report a problem with this skill