ca is an interactive Bash command analyzer that explains what a command really is and where it comes from.
It inspects aliases, functions, builtins, keywords, scripts, and binaries.
Think of it as type, which, help, file, ldd, stat, and half your shell configuration, available through a single command.
Requires: Bash ≥ V4.4 and GNU utils
Package Lookup: supports dpkg, rpm, and pacman
- Detects whether a command is an alias, function, builtin, keyword, or external binary
- Automatically analyzes your most recent command if none is specified
- Displays alias expansions and where they are defined
- Locates function definitions with file and line numbers
- Shows syntax-highlighted previews of function bodies
- Detects disabled builtins and what replaces them
- Identifies commands overridden by aliases, functions, or binaries
- Resolves full paths and symbolic links
- Displays file type, interpreter, ELF details, and linkage
- Lists shared library dependencies and flags missing ones
- Shows binary size in human-readable units
- Reports permissions, ownership, and security risks (SUID, SGID, world-writable)
- Flags commands that likely require root privileges
- Displays file timestamps (create, modify, access, change)
- Lists all sourced shell files, including conditional and loop-based sourcing
- Lists all environment variables
- Lists all variables loaded by sourced files that are found
- Scans
$PATHand highlights writable directories - Identifies user-writable commands
- Shows shell options that differ from defaults
- Maps command shadowing and override conflicts
- Scans for SUID and SGID binaries
- Finds world-writable directories
- Verifies package integrity (dpkg, rpm, pacman)
- Highlights potentially dangerous overrides and path issues
- Designed for interactive Bash shells
- Colorized, structured output with safe fallbacks
- Optional
fzfintegration for interactive command selection - Tab completion for aliases, functions, builtins, and executables
- Modular dependency checking (required vs optional tools)
| Option | Description |
|---|---|
-h, --help |
Show help text |
--version |
Show version information |
-o, --overridden |
List overridden commands |
-a, --alias |
List all aliases |
-f, --function |
List user-defined functions |
-F, --functionv |
List all functions (verbose) |
-d, --diff |
Show shell options changed from defaults |
-e, --env |
List all system variables (printenv / env) |
-s, --sourced |
List sourced shell files |
-p, --path |
Inspect $PATH and highlight writable directories |
-u, --user |
List USER-writable commands |
-S, --scan |
Scan for SUID/SGID binaries and world-writable directories |
-v, --verify |
Verify package integrity (dpkg, rpm, pacman) |
-r, --report |
Full report (includes -t, ca [command], and -v) |
--fzf |
Interactive command selection via fzf |
Clone the repository.
# Clone the repository.
git clone https://github.com/JB63134/bash_ca.git /usr/local/bin/bash_ca
# Source the main script in your .bashrc or .bash_profile
echo "source /usr/local/bin/bash_ca/.bash_ca" >> ~/.bashrc
# Apply changes immediately
source ~/.bashrcA quick method for Debian-based systems:
# Download the latest release
wget https://github.com/JB63134/bash_ca/releases/latest/download/ca_2.0.15.deb
# Install using dpkg
sudo dpkg -i ca_2.0.15.deb
# Verify installation
ca -hA quick method for RHEL-based systems:
# Download the latest release
wget https://github.com/JB63134/bash_ca/releases/latest/download/bash_ca-2.0.15-1.noarch.rpm
# Install using dpkg
sudo dnf install ./bash_ca-2.0.15-1.noarch.rpm
# Verify installation
ca -hca [command]ca ls
ca -v sed
ca -r bash











