Skip to content

Code-Samples-Galore/Terminal-Shortcuts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

96 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Terminal Shortcuts Collection

A comprehensive collection of bash aliases and functions designed to enhance terminal productivity and streamline common development tasks.

๐Ÿš€ Quick Start

โšก๏ธ Installation

  1. Clone or download this repository:
git clone <repository-url> ~/terminal_shortcuts
# or download and extract to ~/terminal_shortcuts
  1. Add to your shell configuration file (~/.bashrc, ~/.zshrc, etc.):
# Add this line to source all terminal shortcuts
source ~/terminal_shortcuts/shortcuts.sh
  1. Reload your shell or run:
source ~/.bashrc  # or ~/.zshrc

๐Ÿ“ Quick Reference

Use sc command to see all available shortcuts and their descriptions.

๐Ÿ“‹ Features Overview

๐Ÿ“ File and Directory Operations

  • Enhanced file listing: ll, la, l with colors and details
  • Smart navigation: .., ..., .... for quick directory traversal
  • Archive operations: Universal extract and compress functions for any archive type with volume splitting support
  • File operations: Find files (ff), find-and-replace (replace), timestamped backups (backup)
  • Directory creation: mkcd to create and enter directories
  • Monitoring: watchfile for real-time file monitoring and watchdir for directory content monitoring
  • File viewing: less (enhanced), le (less), tle (less +G)
  • File analysis: meta for comprehensive file type detection and metadata extraction

๐Ÿ”€ Git Enhancements

  • Quick git operations: gs, gc, gp, ga, etc.
  • Auto-commit: gac with intelligent commit messages
  • Repository info: gitinfo for comprehensive repo status
  • Branch management: Simplified checkout and branch creation

๐Ÿ–ฅ๏ธ System Information & Monitoring

  • System overview: sysinfo for comprehensive system details (OS, CPU, memory, GPU, disk)
  • Process management: killcmd with interactive confirmation for killing processes by name
  • Resource monitoring: topcpu, topmem for CPU and memory usage
  • Time utilities: now, nowtime, nowdate for current time/date
  • History access: h for command history, path for formatted PATH display
  • Service management: sctlstart, sctlstop, sctlrestart, sctlstatus for systemctl operations
  • Log monitoring: sctllog for service logs, sctlwatch for real-time log monitoring
  • Nginx management: nginxstart, nginxstop, nginxrestart, nginxstatus for nginx service control
  • Nginx configuration: nginxconf for config editing, nginxtest for syntax validation, nginxreload for config reload
  • Package management: brewi for Homebrew package installation, brewu for updating and upgrading packages (macOS)

๐ŸŒ Network Utilities

  • Website monitoring: isup to check if websites are accessible
  • IP information: myip for local and external IP addresses
  • Network monitoring: ports for active connections
  • Enhanced ping: Standard and fast ping options

๐Ÿ Python Development

  • Virtual environment: svenv for automatic venv activation, cdsvenv for navigate and activate
  • Create and bootstrap venv: cvenv to create .venv with conda's Python, activate it, and upgrade pip
  • Quick Python access: p alias for python3
  • Package management: pipi, pupu, pipl for pip operations
  • Dependency analysis: preq for analyzing project dependencies and environment
  • Testing with coverage: pytestcov for running tests with coverage reports
  • Code formatting: pfmt for formatting and linting with black, isort, and flake8
  • Module execution: pm for running Python modules using file paths
  • Class inspection: pmem for displaying members of classes

๐Ÿ“ฆ Node.js Development

  • Version management: nu, nl, ni for nvm operations
  • Quick switching: Easy Node.js version switching

โœ๏ธ Quick Configuration Access

  • Config editing: bashrc, zshrc, vimrc for instant config file access
  • Config reloading: sobashrc, sozshrc for quick shell configuration reload

๐Ÿš€ Program Shortcuts

  • Editor access: v for Vim
  • Source config: so for source (reload shell config)

๐Ÿ› ๏ธ Development Tools

  • API testing: apitest for quick HTTP API testing with curl
  • Asset optimization: optimizeassets for minifying JavaScript and CSS files
  • Hash computation: hashit for MD5, SHA1, SHA256, SHA512 hashing of strings, files, or stdin
  • Password generation: randstr for secure random passwords
  • String/data conversion: strconv for converting between hex, base64, and binary formats
  • Number base conversion: numconv for converting numbers between different bases (2-36) with auto-detection
  • Unit conversion: unitconv for converting between different units of measurement
  • Entropy analysis: entropy for calculating Shannon entropy of strings, files, or stdin
  • Mathematical calculations: calc, log2, and pow2 functions
  • JSON formatting: jsonpp for pretty-printing JSON

๐Ÿ“ Wordlist Processing

  • Advanced filtering: Filter by length, character types, entropy, regex patterns
  • Data processing: Sort, remove duplicates, randomize word order
  • Output options: Split by size (MB/GB) or percentage distribution
  • Memory efficiency: Streaming processing for large files
  • Pattern matching: Case-sensitive/insensitive regex support

๐Ÿ“š Cheatsheets

  • Vim reference: csvim for comprehensive Vim usage guide including custom configurations
  • tmux reference: cstmux for terminal multiplexer usage with sessions, windows, and panes
  • less reference: csless for file viewer navigation, search, and advanced features
  • Terminator reference: csterminator for advanced terminal emulator with splits and layouts
  • Terminal shortcuts: csterminal for comprehensive terminal keyboard shortcuts and command line editing

๐Ÿ“– Detailed Function Reference

๐Ÿ–ฅ๏ธ System Information (sysinfo)

Displays comprehensive system information including:

  • OS details and kernel version
  • CPU specifications and core count
  • Memory usage and availability
  • GPU information (NVIDIA, macOS, Linux)
  • Disk usage statistics
$ sysinfo
=== SYSTEM INFORMATION ===
OS Information:
Hostname: my-computer
OS: Darwin
Kernel: 21.6.0
...

๐Ÿงฉ Function Listing (list_functions)

Display all defined functions in the current shell session with optional filtering:

$ list_functions                   # List all functions
$ list_functions git               # List functions containing 'git'
$ list_functions '^c'              # List functions starting with 'c'
$ list_functions 'backup|restore'  # List functions with 'backup' or 'restore'

Features:

  • Alphabetically sorted output for easy browsing
  • Optional grep pattern filtering for targeted searches
  • Includes both built-in shell functions and user-defined functions
  • Shows total count of functions found
  • Supports regular expressions for advanced filtering

Common Use Cases:

  • Explore available functions in your shell environment
  • Find functions related to specific tasks (e.g., git, file operations)
  • Debug shell configurations by listing loaded functions
  • Discover functions from loaded modules and scripts

๐Ÿ—‘๏ธ Process Management (killcmd)

Interactive process termination by command name:

$ killcmd firefox
=== KILL COMMAND ===
Searching for processes containing: 'firefox'
Found 3 matching process(es):
PID: 1234 - /Applications/Firefox.app/Contents/MacOS/firefox
Kill all these processes? (y/N):

๐Ÿ›Ž๏ธ Service Management

๐Ÿ› ๏ธ Systemctl Operations (sctlstart, sctlstop, sctlrestart, sctlstatus)

Simplified systemd service management:

$ sctlstart nginx           # Start nginx service
$ sctlstop apache2          # Stop apache2 service
$ sctlrestart ssh           # Restart SSH service
$ sctlstatus postgresql     # Check PostgreSQL status

๐Ÿ“œ Service Logging (sctllog, sctlwatch)

Monitor systemd service logs:

$ sctllog nginx             # View nginx service logs
$ sctlwatch apache2         # Watch apache2 logs in real-time

๐Ÿ•ธ๏ธ Nginx Management (nginxstart, nginxstop, nginxrestart, nginxstatus, nginxconf, nginxtest, nginxreload)

Complete nginx service control:

$ nginxstart                # Start nginx service
$ nginxstop                 # Stop nginx service
$ nginxrestart              # Restart nginx service
$ nginxstatus               # Check nginx status
$ nginxconf                 # Edit nginx configuration
$ nginxtest                 # Test nginx configuration syntax
$ nginxreload               # Reload nginx configuration

๐Ÿ“ฆ Archive Operations (extract, compress)

๐Ÿ“ค Universal Archive Extractor (extract)

Automatically detects and extracts any archive format:

$ extract archive.zip        # Extract ZIP file
$ extract data.tar.gz       # Extract gzipped tar
$ extract backup.rar        # Extract RAR file
$ extract package.7z        # Extract 7-Zip file

Supports: .zip, .tar, .tar.gz, .tar.bz2, .tar.xz, .rar, .7z, .gz, .bz2, .xz, and more.

๐Ÿ“ฆ Archive Creator (compress)

Create archives with optional volume splitting:

$ compress myfile.zip file1.txt file2.txt     # Create ZIP archive
$ compress backup.tar.gz folder/             # Create gzipped tar
$ compress data.7z -v100M file1 file2        # Create 7z with 100MB volumes
$ compress split.zip -v1G large_folder/      # Create ZIP with 1GB volumes

๐Ÿ“ File Operations

๐Ÿ” Find Files (ff)

Search for files by name pattern:

$ ff "*.py"           # Find all Python files
$ ff "config"         # Find files containing "config"
$ ff "test*.js"       # Find JavaScript test files

๐Ÿ”Ž Search in Files (search)

Advanced text search with regex support:

$ search "pattern" file.txt                    # Basic search
$ search -i "case insensitive" *.txt          # Case insensitive
$ search -r "regex.*pattern" directory/       # Extended regex
$ search -g "compressed" archive.gz           # Search in gzipped files

๐Ÿ“ Find and Replace (replace)

Replace text in strings, files, or stdin:

$ replace "old" "new" "old text here"         # Replace in string
$ replace "old" "new" file.txt               # Replace in file
$ echo "old text" | replace "old" "new" -   # Replace from stdin

๐Ÿ—„๏ธ File Backup (backup)

Create timestamped backups with optional compression:

$ backup file.txt                    # Create backup: file.txt.backup.20231201-143022
$ backup -c folder/                  # Create compressed backup: folder.backup.20231201-143022.tar.gz
$ backup -c -z file.txt             # Create gzipped backup

๐Ÿท๏ธ File Metadata Analysis (meta)

Display comprehensive file type information and extract metadata automatically based on file type:

$ meta photo.jpg                     # Show image EXIF data, dimensions, camera info
$ meta document.pdf                  # Show PDF properties, page count, author
$ meta video.mp4                     # Show video codec, resolution, duration
$ meta song.mp3                      # Show audio metadata, bitrate, artist, album
$ meta archive.zip                   # Show archive contents and compression info
$ meta script.py                     # Show text file encoding, line count, word count
$ meta program                       # Show executable architecture, libraries

Supported File Types:

  • Images: JPEG, PNG, GIF, TIFF, BMP, WebP - Shows EXIF data, dimensions, camera settings, GPS coordinates
  • Documents: PDF, DOC, DOCX - Shows document properties, page count, author, creation date
  • Videos: MP4, AVI, MOV, MKV, WebM - Shows duration, resolution, codec info, frame rate, GPS data
  • Audio: MP3, WAV, FLAC, OGG, M4A - Shows duration, bitrate, artist, album, genre metadata
  • Archives: ZIP, TAR, RAR, 7z - Shows contents list and compression information
  • Text files: Shows encoding, line count, word count, character count
  • Executables: Shows architecture, linked libraries, file format details

Required Tools (auto-detected):

  • exiftool - Most comprehensive metadata extraction for images, videos, audio
  • pdfinfo - PDF document information (from poppler-utils)
  • mediainfo - Video and audio file analysis
  • identify - ImageMagick image information
  • Standard tools: file, stat, wc, readelf, ldd

๐Ÿ‘€ File Monitoring

๐Ÿ‘๏ธโ€๐Ÿ—จ๏ธ Watch Log Files (watchlog)

Monitor log file changes in real-time:

$ watchlog /var/log/nginx/access.log    # Monitor nginx access log
$ watchlog app.log                      # Monitor application log

๐Ÿ—‚๏ธ Watch Directory (watchdir)

Monitor directory contents for changes:

$ watchdir /home/user/downloads/        # Watch downloads folder
$ watchdir .                           # Watch current directory

๐Ÿ Python Development Tools

๐Ÿ“ฆ Package Management (pipi, pupu, pipl)

Simplified pip operations:

$ pipi requests flask       # Install packages
$ pipi requirements.txt     # Install from requirements file
$ pupu requests            # Upgrade specific package
$ pupu                     # Upgrade all packages
$ pupu requirements.txt    # Upgrade packages from requirements
$ pipl                     # List installed packages

๐Ÿงช Virtual Environment Auto-Activation (svenv)

Automatically detect and activate Python virtual environments:

$ svenv
Activated virtual environment: /home/user/project/.venv

Searches for virtual environments in: .venv/, venv/, .virtualenv/

๐Ÿ“‚ Navigate and Activate (cdsvenv)

Navigate to project directory and activate virtual environment:

$ cdsvenv ~/myproject        # Navigate and activate venv
$ cdsvenv                   # Use current directory

๐Ÿ—๏ธ Create Virtual Environment (cvenv)

Create .venv using conda's Python, activate it, and upgrade pip:

$ cvenv                     # Create venv in current directory
$ cvenv myproject           # Create venv in myproject/ directory

๐Ÿƒ Python Module Runner (pm)

Run Python modules using file paths:

$ pm script.py              # Run script.py as module
$ pm path/to/module.py      # Run module with full path

๐Ÿ•ต๏ธ Python Class Inspector (pmem)

Display public members (methods and attributes) of Python built-in classes:

$ pmem str                       # Show public members of str class
$ pmem -m list                   # Show magic methods of list class
$ pmem --magic dict              # Show magic methods of dict class
$ pmem -a bytearray              # Show both public and magic methods
$ pmem --all int                 # Show both public and magic methods
$ pmem -d str                    # Show public members with docstrings
$ pmem -ad list                  # Show all members with docstrings
$ pmem -md dict                  # Show magic methods with docstrings
$ pmem xmlrpc.client.ServerProxy # Show ServerProxy class members
$ pmem -d urllib.request.Request # Show Request class with docstrings
$ pmem pathlib.Path              # Show Path class members

Class Specification:

  • Built-in classes: Use simple names like str, int, list, dict
  • Module classes: Use dot notation like xmlrpc.client.ServerProxy, urllib.request.Request

Options:

  • Default: Shows public members (methods and attributes that don't start with underscore)
  • -m, --magic: Shows magic methods (names starting with __)
  • -a, --all: Shows both public and magic methods in separate sections
  • -d, --docs: Shows docstrings for each member (when available)

The function automatically imports required modules when using dot notation, making it easy to explore any Python class without manual imports.

Common Examples:

  • pmem xmlrpc.client.ServerProxy - XML-RPC client methods
  • pmem urllib.request.Request - HTTP request class
  • pmem pathlib.Path - Modern path handling
  • pmem json.JSONEncoder - JSON encoding methods
  • pmem sqlite3.Connection - Database connection methods

๐Ÿ“Š Python Dependency Analysis (preq)

Analyze Python project dependencies and environment information:

$ preq                             # Analyze current project dependencies

Features:

  • Detects and analyzes requirements.txt files
  • Shows installed packages matching requirements
  • Lists outdated packages with current/latest versions
  • Supports Pipenv projects with dependency graphs
  • Displays virtual environment disk usage
  • Detects Poetry projects in pyproject.toml files
  • Shows active virtual environment information

Supported Configuration Files:

  • requirements.txt - Standard pip requirements
  • Pipfile - Pipenv project dependencies
  • pyproject.toml - Poetry and other modern Python projects

Output Information:

  • Installed vs required packages comparison
  • Outdated packages that need updates
  • Virtual environment size and location
  • Dependency graphs for Pipenv projects
  • Active environment status

๐Ÿงช Python Testing with Coverage (pytestcov)

Run Python tests with comprehensive coverage analysis:

$ pytestcov                        # Test current directory with coverage
$ pytestcov tests/                 # Test specific directory
$ pytestcov test_module.py         # Test specific file
$ pytestcov tests/ -v              # Verbose output
$ pytestcov . --tb=short           # Short traceback format
$ pytestcov tests/ -k "unit"       # Run only tests matching 'unit'

Features:

  • Automatic installation of pytest and pytest-cov if missing
  • Terminal coverage report with missing lines highlighted
  • HTML coverage report with detailed file-by-file analysis
  • Test execution statistics and comprehensive reporting
  • Supports all standard pytest options and filters
  • Generates interactive HTML coverage reports

Generated Output:

  • Terminal coverage report with line-by-line analysis
  • htmlcov/index.html - Interactive HTML coverage report
  • .coverage - Coverage data file for further analysis
  • Test execution summary with pass/fail statistics

Requirements:

  • Python testing environment with write permissions
  • Automatic tool installation via pip

๐ŸŽจ Python Code Formatting (pfmt)

Format and lint Python code using industry-standard tools:

$ pfmt                             # Format current directory
$ pfmt src/                        # Format specific directory
$ pfmt module.py                   # Format specific file
$ pfmt --check                     # Check formatting without changes
$ pfmt --diff src/                 # Show formatting differences
$ pfmt --line-length 100 .         # Use custom line length

Tools Integration:

  • black - PEP 8 compliant code formatter
  • isort - Import statement organizer with black compatibility
  • flake8 - Code style checker and linter

Features:

  • Automatic tool installation if missing
  • Consistent code formatting across entire projects
  • Import organization compatible with black formatting
  • Configurable line length (default: 88 characters)
  • Check and diff modes for CI/CD integration
  • Compatible with popular development workflows

Configuration:

  • Line length: 88 characters (black default, configurable)
  • flake8 ignores: E203 (whitespace before ':'), W503 (line break before operator)
  • isort profile: black (ensures compatibility)
  • In-place formatting with version control recommended

Options:

  • --check - Verify formatting without making changes
  • --diff - Show what would be changed without applying
  • --line-length N - Set custom maximum line length

๐Ÿ“ฆ Node.js Development Tools

๐Ÿ”ข Node Version Management (nu, nl, ni)

Simplified nvm operations for Node.js version management:

$ nu 18.17.0               # Use Node.js version 18.17.0
$ nu lts                   # Use latest LTS version
$ nl                       # List installed Node.js versions
$ ni 20.5.0                # Install Node.js version 20.5.0
$ ni --lts                 # Install latest LTS version

๐Ÿ•ฐ๏ธ Time and Date Utilities (now, nowtime, nowdate)

Get current time and date information:

$ now                      # Current date and time: 2023-12-01 14:30:22
$ nowtime                  # Current time only: 14:30:22
$ nowdate                  # Current date only: 2023-12-01

๐Ÿ“ˆ Resource Monitoring (topcpu, topmem)

Monitor system resource usage:

$ topcpu                   # Show top processes by CPU usage
$ topmem                   # Show top processes by memory usage

Output shows processes sorted by resource consumption with PID, user, and command details.

๐ŸŒ Network Monitoring (isup, myip)

Check website availability:

$ isup google.com
google.com is UP

$ isup badsite.xyz
badsite.xyz is DOWN

Show IP address information:

$ myip
=== IP ADDRESS INFORMATION ===

Local IP Address:
  192.168.1.100

External IP Address:
  203.0.113.45

๐ŸŒ Network Utilities (ports)

Show active network connections and listening ports:

$ ports                    # Display all network connections and listening ports

Shows local/remote addresses, connection states, and associated processes.

๐Ÿ”Ž Git Repository Information (gitinfo)

Display comprehensive Git repository status:

$ gitinfo
=== GIT REPOSITORY INFORMATION ===

Repository Path: /home/user/myproject
Branch: main
Status: Clean working directory

Remote Origin:
  https://github.com/user/myproject.git

Recent Commits:
  a1b2c3d - Fix bug in authentication (2 hours ago)
  d4e5f6g - Add new feature (1 day ago)

โš™๏ธ Configuration Management

โšก๏ธ Quick Configuration Access (bashrc, zshrc, vimrc, nginxconf)

Instantly open configuration files for editing:

$ bashrc                   # Edit ~/.bashrc
$ zshrc                    # Edit ~/.zshrc  
$ vimrc                    # Edit ~/.vimrc
$ nginxconf                # Edit /etc/nginx/nginx.conf

๐Ÿ”„ Configuration Reloading (sobashrc, sozshrc)

Quickly reload shell configurations:

$ sobashrc                 # Reload ~/.bashrc
$ sozshrc                  # Reload ~/.zshrc

๐Ÿ“‚ Directory Navigation Enhancements

๐Ÿšถโ€โ™‚๏ธ Smart Navigation (.., ..., ...., ~)

Quick directory traversal shortcuts:

$ ..                       # Go up one directory (cd ..)
$ ...                      # Go up two directories (cd ../..)
$ ....                     # Go up three directories (cd ../../..)
$ ~                        # Go to home directory (cd ~)

๐Ÿ—๏ธ Create and Navigate (mkcd)

Create directory and navigate into it in one command:

$ mkcd new_project         # Create and enter new_project directory
$ mkcd path/to/deep/dir    # Create nested directories and navigate

๐Ÿ“ƒ Enhanced File Listing

๐Ÿ“„ File Listing Variants (ll, la, l)

Enhanced directory listing with different detail levels:

$ ll                       # Detailed list with human-readable sizes (ls -lh)
$ la                       # List all files including hidden (ls -la)
$ l                        # Compact column format (ls -CF)

๐Ÿ‘๏ธ File Viewing Enhancements

๐Ÿ”Ž Enhanced Less (less, le, tle)

Improved file viewing with enhanced less functionality:

$ less file.txt            # Enhanced less with colors and mouse support
$ le file.txt              # Alias for less
$ tle file.txt             # Open file with less, start at end (+G)

Features include syntax highlighting, mouse support, and improved navigation.

๐Ÿ›ค๏ธ System Path and History

๐Ÿ›ฃ๏ธ Path Display (path)

Format and display the system PATH variable:

$ path                     # Display PATH with each directory on separate line

๐Ÿ•ฐ๏ธ Command History (h)

Quick access to command history:

$ h                        # Display command history
$ h pattern                # Search history for pattern

๐Ÿ–ฅ๏ธ tmux Session Management (ta)

Quick tmux session attachment:

$ ta session_name          # Attach to named tmux session
$ ta                       # Attach to most recent session

๐Ÿ› ๏ธ Development Tools

๐Ÿงช API Testing (apitest)

Quick HTTP API testing tool using curl with automatic formatting and timing:

$ apitest localhost:3000/api/users                    # GET request
$ apitest api.example.com/data GET                    # Explicit GET
$ apitest localhost/api/users POST '{"name":"John"}'  # POST with data
$ apitest api.site.com/users/1 PUT '{"age":25}'       # PUT request
$ apitest localhost:8080/api/users/1 DELETE           # DELETE request
$ apitest https://api.github.com/users/octocat         # External API

Features:

  • Automatic Content-Type and Accept headers for JSON
  • Response time measurement and HTTP status code display
  • Support for GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS methods
  • Automatic protocol detection (adds http:// if missing)
  • Pretty formatted output with response information
  • Error handling with helpful troubleshooting tips

Response Information:

  • HTTP status code
  • Response time in seconds
  • Response size in bytes
  • Complete response body

๐Ÿ—œ๏ธ Asset Optimization (optimizeassets)

Optimize web assets by minifying JavaScript and CSS files:

$ optimizeassets                   # Optimize current directory
$ optimizeassets ./src/assets      # Optimize specific directory
$ optimizeassets /path/to/project  # Optimize project directory
$ optimizeassets ../public         # Optimize relative path

Features:

  • Automatic minification of JavaScript files using UglifyJS
  • Automatic minification of CSS files using clean-css
  • Preserves original files while creating .min.js and .min.css versions
  • Skips already minified files and node_modules directories
  • Automatic tool installation via npm if not present
  • File size reduction reporting with percentage savings
  • Smart file timestamp checking to avoid unnecessary reprocessing

Requirements:

  • Node.js and npm installed
  • Write permissions in target directory
  • npm global install permissions (for tool installation)

Output Information:

  • Progress reporting for each processed file
  • File size reduction percentages
  • Summary of processed files and any errors
  • Skips files that are already up to date

Supported File Types:

  • JavaScript: .js files (creates .min.js)
  • CSS: .css files (creates .min.css)
  • Automatically excludes already minified files (.min.js, .min.css)

๐Ÿ”‘ Hash Calculator (hashit)

Compute various hash functions for strings, files, or stdin. Supports both simple cryptographic hashes and secure password hashes:

Simple Hash Functions:

$ hashit sha256 "hello world"     # Hash a string: a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e
$ hashit md5 myfile.txt          # Hash a file: 5d41402abc4b2a76b9719d911017c592
$ echo "data" | hashit sha1 -    # Hash stdin: a17c9aaa61e80a1bf71d0d850af4e5baa9800bbd
$ hashit blake2 "secret data"    # BLAKE2 hash (modern, fast algorithm)
$ hashit crc32 "integrity check" # CRC32 checksum: 3632233996

Password Hash Functions (with salt):

$ hashit bcrypt "password123"       # Bcrypt hash: $2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewdBXFhAsC/HjBKS
$ hashit argon2 "password123"       # Argon2id hash: $argon2id$v=19$m=4096,t=3,p=1$salt$hash
$ hashit sha256crypt "password"     # SHA-256 crypt: $5$saltvalue$hashvalue
$ hashit sha512crypt "password"     # SHA-512 crypt: $6$saltvalue$hashvalue
$ echo "mypassword" | hashit bcrypt - # Hash password from stdin

Supported Hash Types:

  • Simple hashes: md5, sha1, sha224, sha256, sha384, sha512, blake2, sha3, crc32
  • Password hashes: bcrypt, argon2, sha256crypt, sha512crypt

Password hashes automatically include random salt and produce different outputs each time for security.

๐ŸŽฒ Entropy Calculator (entropy)

Calculate Shannon entropy for strings, files, or stdin to measure randomness/complexity:

$ entropy "hello world"          # Calculate entropy of string
$ entropy passwords.txt          # Calculate entropy of file contents
$ echo "random data" | entropy - # Calculate entropy of stdin

Entropy values range from 0 (completely predictable) to ~8 (maximum randomness for byte data).

๐Ÿ”„ String/Data Converter (strconv)

Convert between different data encodings and representations:

$ strconv hex "hello"              # Encode to hex: 68656c6c6f
$ strconv hex-decode "68656c6c6f"  # Decode hex: hello
$ strconv base64 "hello world"     # Encode to Base64: aGVsbG8gd29ybGQ=
$ strconv b64-d "aGVsbG8gd29ybGQ="  # Decode Base64: hello world
$ strconv bin 255                  # Integer to binary: 11111111
$ strconv bin "A"                  # String to binary: 01000001
$ echo "data" | strconv hex -      # Encode stdin to hex
$ cat file.txt | strconv base64 -  # Encode file to Base64

Supports:

  • Hexadecimal: hex (encode), hex-decode/hex-d (decode)
  • Base64: base64/b64 (encode), base64-decode/b64-d (decode)
  • Binary: bin/binary (integers to binary numbers, strings to ASCII binary)

๐Ÿ”ข Number Base Converter (numconv)

Convert numbers between different bases (2-36) with auto-detection:

$ numconv 255                    # Auto-detect: 255 (decimal) = 0xff (hex) = 0o377 (octal) = 0b11111111 (binary)
$ numconv 0xff                   # Hex to all: 0xff = 255 (decimal) = 0o377 (octal) = 0b11111111 (binary)
$ numconv 0b1010                 # Binary to all: 0b1010 = 10 (decimal) = 0xa (hex) = 0o12 (octal)
$ numconv 777 8                  # Convert 777 from base 8: 777โ‚ˆ = 511 (decimal)
$ numconv 255 16                 # Convert 255 to base 16: 255 = ffโ‚โ‚†
$ numconv abc 16 2               # Convert abc from base 16 to base 2: abcโ‚โ‚† = 101010111100โ‚‚

Range conversion (convert multiple consecutive numbers):

$ numconv 100-110 hex            # Convert 100-110 to hex: 64, 65, 66, ..., 6E
$ numconv 0x10-0x1F dec          # Convert hex 10-1F to decimal: 16, 17, ..., 31
$ numconv 8-12 bin               # Convert 8-12 to binary: 1000, 1001, ..., 1100
$ numconv 250-255 hex            # Convert 250-255 to hex: FA, FB, FC, FD, FE, FF

Range format supports the same base auto-detection and supports up to 1000 numbers per range.

๐Ÿ“ Unit Converter (unitconv)

Convert between different units of measurement across multiple categories:

$ unitconv 100 cm m              # Convert 100 cm to meters: 1
$ unitconv 32 f c                # Convert 32ยฐF to Celsius: 0
$ unitconv 1 km mi               # Convert 1 km to miles: 0.621371
$ unitconv 1000 g kg             # Convert 1000g to kg: 1
$ unitconv 1 gb mb               # Convert 1 GB to MB: 1000
$ unitconv 24 h min              # Convert 24 hours to minutes: 1440
$ unitconv 1 m2 ft2              # Convert 1 mยฒ to ftยฒ: 10.7639
$ unitconv 1 l ml                # Convert 1 liter to ml: 1000

Supported Categories:

Length Units:

  • Metric: mm, cm, m, km, nm, um
  • Imperial: in, ft, yd, mi, mil

Weight/Mass Units:

  • Metric: mg, g, kg, t
  • Imperial: oz, lb, st, ton

Temperature Units:

  • c (Celsius), f (Fahrenheit), k (Kelvin)

Volume Units:

  • Metric: ml, l
  • Imperial: gal, qt, pt, cup, fl_oz, tsp, tbsp

Area Units:

  • Metric: mm2, cm2, m2, km2, ha
  • Imperial: in2, ft2, yd2, mi2, acre

Time Units:

  • ms, s, min, h, d, w, mo, y

Data/Storage Units:

  • Decimal: b, kb, mb, gb, tb, pb
  • Binary: kib, mib, gib, tib, pib

Features:

  • Case-insensitive unit names
  • High precision calculations using bc
  • Automatic decimal cleanup for clean output
  • Cross-category conversion prevention
  • Comprehensive error handling and validation

๐Ÿ” Random Password Generator (randstr)

Generate secure random passwords:

$ randstr              # Generate 12-character password: aB3$xY9!mN2@
$ randstr 16           # Generate 16-character password
$ randstr 8            # Generate 8-character password

๐Ÿงฎ Mathematical Calculators (calc, log2, pow2)

Calculator (calc):

$ calc "2 + 3 * 4"          # Result: 14
$ calc "sqrt(16)"           # Result: 4
$ calc "sin(pi/2)"          # Result: 1
$ calc "log(100)"           # Result: 2 (base 10)

Base-2 Logarithm (log2):

$ log2 8                    # Result: 3 (since 2ยณ = 8)
$ log2 1024                 # Result: 10 (since 2ยนโฐ = 1024)

Powers of 2 (pow2):

$ pow2 3                    # Result: 8 (2ยณ)
$ pow2 10                   # Result: 1024 (2ยนโฐ)

๐Ÿงพ JSON Pretty Printer (jsonpp)

Format and pretty-print JSON data:

$ jsonpp data.json          # Pretty-print JSON file
$ echo '{"a":1,"b":2}' | jsonpp -    # Pretty-print JSON from stdin

๐Ÿ“ Wordlist Processor (wordlist)

Advanced wordlist filtering and processing:

$ wordlist -l 8-12 passwords.txt          # Filter by length 8-12 characters
$ wordlist -a words.txt                   # Filter alphabetic only
$ wordlist -n data.txt                    # Filter numeric only
$ wordlist -e 4.0- entropy.txt           # Filter by minimum entropy 4.0
$ wordlist -r "^[a-z]+$" words.txt        # Filter by regex pattern
$ wordlist -s size output.txt input.txt   # Sort and remove duplicates
$ wordlist -x 10 random.txt              # Randomize and take 10 entries
$ wordlist --split-mb 100 large.txt      # Split into 100MB files

๐Ÿ“š Cheatsheets (csvim, cstmux, csless, csterminator, csterminal)

๐Ÿ“ Vim Cheatsheet (csvim)

Comprehensive Vim cheatsheet covering:

  • Basic usage and modes (normal, insert, visual)
  • Navigation commands and movement
  • Editing operations (cut, copy, paste, undo/redo)
  • Search and replace functionality
  • File operations and buffer management
  • Window splits and tab management
  • Folding operations
  • Custom leader key mappings (Leader = )
  • Plugin shortcuts (NERDTree, Tagbar, ALE)
  • Autoclose features for quotes and brackets
  • Advanced tips and configuration features
$ csvim
=== VIM CHEATSHEET ===

๐Ÿš€ BASIC USAGE:
  vim [file]      - Open file in vim
  vim +[line]     - Open file at specific line
  ...

๐Ÿ–ฅ๏ธ tmux Cheatsheet (cstmux)

Comprehensive tmux cheatsheet covering:

  • Session management (create, attach, detach, list)
  • Window operations (create, switch, rename, close)
  • Pane management (split, navigate, resize, zoom)
  • Copy mode and text selection
  • Key bindings and prefix commands
  • Configuration tips and common settings
  • Workflow examples and best practices
$ cstmux
=== TMUX CHEATSHEET ===

๐Ÿš€ BASIC USAGE:
  tmux                - Start new session
  tmux new -s name    - Start new session with name
  tmux attach -t name - Attach to named session
  ...

๐Ÿ“– less Cheatsheet (csless)

Comprehensive less cheatsheet covering:

  • Basic file viewing and navigation
  • Forward and backward movement (screens, lines, half-screens)
  • Search functionality (forward, backward, filtering)
  • Marks and position management
  • File operations and multiple file handling
  • Display options and customization
  • Color and highlighting features
  • Horizontal scrolling for long lines
  • Command-line options and environment variables
  • Advanced search with regular expressions
  • Common workflows and pro tips
$ csless
=== LESS CHEATSHEET ===

๐Ÿš€ BASIC USAGE:
  less file.txt       - Open file with less
  cat file | less     - Pipe output to less
  less +G file.txt    - Open file at end
  ...

๐Ÿ–ฅ๏ธ Terminator Cheatsheet (csterminator)

Comprehensive Terminator cheatsheet covering:

  • Window and terminal management
  • Terminal splitting (horizontal and vertical)
  • Tab management and navigation
  • Terminal resizing and arrangement
  • Search and find functionality
  • Copy, paste, and text selection
  • Display options and zoom controls
  • Profiles and layout management
  • Broadcasting and terminal grouping
  • Configuration file examples
  • Command-line options and startup
  • Plugin system and customization
  • Common workflows and tips
$ csterminator
=== TERMINATOR CHEATSHEET ===

๐Ÿš€ BASIC USAGE:
  terminator              - Start Terminator
  terminator -l layout    - Start with specific layout
  terminator -x command   - Execute command in new window
  ...

โŒจ๏ธ Terminal Cheatsheet (csterminal)

Comprehensive terminal keyboard shortcuts cheatsheet covering:

  • Cursor movement and navigation within command line
  • Text cutting, deleting, and pasting operations
  • Command history search and navigation
  • Tab completion and text expansion
  • Process control signals (Ctrl+c, Ctrl+z, etc.)
  • Display and terminal control commands
  • Advanced command line editing features
  • ZSH-specific shortcuts and enhancements
  • Argument manipulation and word operations
  • Advanced shortcuts for power users
  • Background process management (jobs, fg, bg)
  • Workflow examples and practical tips
  • Key binding customization guidance
$ csterminal
=== TERMINAL CHEATSHEET (BASH/ZSH) ===

๐Ÿ“ CURSOR MOVEMENT:
  Ctrl+a          - Move to beginning of line
  Ctrl+e          - Move to end of line
  Alt+f           - Move forward one word
  ...

๐Ÿ“„ License

MIT License.

About

Terminal shortcuts collection.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages