diff --git a/bash-helper.sh b/bash-helper.sh index f0cd6c0..4f0297e 100755 --- a/bash-helper.sh +++ b/bash-helper.sh @@ -82,7 +82,7 @@ show_help() { echo " To switch models, edit mode_ai() function" echo "" echo -e "${YELLOW}Database:${NC} $DB_FILE" - echo -e "${YELLOW}Version:${NC} 2.1.0 (90+ commands, AI-powered)" + echo -e "${YELLOW}Version:${NC} 2.1.0 (250+ commands, AI-powered)" echo "" } @@ -993,6 +993,208 @@ COMMANDS=( "env:Display environment variables | env [OPTION]... [NAME=VALUE]... [COMMAND]" "man:Display manual pages | man [OPTION]... [SECTION] PAGE" "watch:Execute command periodically | watch [OPTION]... COMMAND" + + # File Operations (extended) + "dd:Convert and copy a file (block-level) | dd if=SOURCE of=DEST [OPERAND]..." + "shred:Overwrite a file to securely delete it | shred [OPTION]... FILE..." + "truncate:Shrink or extend file size | truncate [OPTION]... -s SIZE FILE..." + "mktemp:Create a temporary file or directory | mktemp [OPTION]... [TEMPLATE]" + "mkfifo:Create a named pipe (FIFO) | mkfifo [OPTION]... NAME..." + "install:Copy files and set attributes | install [OPTION]... SOURCE DEST" + "basename:Strip directory and suffix from a path | basename NAME [SUFFIX]" + "dirname:Strip last component from a path | dirname [OPTION] NAME..." + "realpath:Print the resolved absolute path | realpath [OPTION]... FILE..." + "readlink:Print resolved symbolic link target | readlink [OPTION]... FILE..." + "tree:List directory contents as a tree | tree [OPTION]... [DIRECTORY]" + "rsync:Fast incremental file transfer/sync | rsync [OPTION]... SOURCE DEST" + "pushd:Push directory onto the stack | pushd [DIRECTORY]" + "popd:Pop directory off the stack | popd [+N|-N]" + "rename:Rename multiple files via pattern | rename [OPTION]... EXPRESSION FILE..." + + # Text Processing (extended) + "tee:Read stdin and write to files and stdout | tee [OPTION]... [FILE]..." + "tac:Concatenate and print files in reverse | tac [OPTION]... [FILE]..." + "nl:Number lines of files | nl [OPTION]... [FILE]..." + "fold:Wrap lines to a fixed width | fold [OPTION]... [FILE]..." + "fmt:Reformat paragraph text | fmt [OPTION]... [FILE]..." + "paste:Merge lines of files side by side | paste [OPTION]... [FILE]..." + "join:Join lines of two files on a field | join [OPTION]... FILE1 FILE2" + "comm:Compare two sorted files line by line | comm [OPTION]... FILE1 FILE2" + "column:Format input into columns | column [OPTION]... [FILE]..." + "expand:Convert tabs to spaces | expand [OPTION]... [FILE]..." + "unexpand:Convert spaces to tabs | unexpand [OPTION]... [FILE]..." + "rev:Reverse characters in each line | rev [OPTION]... [FILE]..." + "split:Split a file into pieces | split [OPTION]... [FILE [PREFIX]]" + "csplit:Split a file by context lines | csplit [OPTION]... FILE PATTERN..." + "od:Dump files in octal/other formats | od [OPTION]... [FILE]..." + "hexdump:Display file contents in hex | hexdump [OPTION]... [FILE]..." + "xxd:Make a hexdump or reverse it | xxd [OPTION]... [FILE]" + "strings:Print printable strings in a file | strings [OPTION]... [FILE]..." + "iconv:Convert text between encodings | iconv [OPTION]... [FILE]..." + "jq:Process and query JSON data | jq [OPTION]... FILTER [FILE]..." + "pr:Paginate/columnate files for printing | pr [OPTION]... [FILE]..." + "printf:Format and print data | printf FORMAT [ARGUMENT]..." + + # File Search (extended) + "type:Describe how a command name is resolved | type [OPTION]... NAME..." + "command:Run a command bypassing aliases | command [OPTION]... NAME [ARG]..." + "apropos:Search the manual page names | apropos [OPTION]... KEYWORD..." + "updatedb:Update the locate file database | updatedb [OPTION]..." + "xargs:Build and execute commands from stdin | xargs [OPTION]... [COMMAND]" + + # Compression (extended) + "bzip2:Compress files with bzip2 | bzip2 [OPTION]... [FILE]..." + "bunzip2:Decompress bzip2 files | bunzip2 [OPTION]... [FILE]..." + "xz:Compress files with xz/LZMA | xz [OPTION]... [FILE]..." + "unxz:Decompress xz files | unxz [OPTION]... [FILE]..." + "zcat:Print gzip-compressed files | zcat [OPTION]... [FILE]..." + "zstd:Compress files with Zstandard | zstd [OPTION]... [FILE]..." + "7z:7-Zip archive manager | 7z COMMAND [OPTION]... ARCHIVE [FILE]..." + "cpio:Copy files to/from archives | cpio [OPTION]..." + + # Network (extended) + "dig:DNS lookup utility | dig [OPTION]... [@SERVER] NAME [TYPE]" + "nslookup:Query DNS records interactively | nslookup [OPTION]... [HOST] [SERVER]" + "host:DNS lookup utility (simple) | host [OPTION]... NAME [SERVER]" + "traceroute:Trace route packets take to a host | traceroute [OPTION]... HOST" + "mtr:Combined traceroute and ping tool | mtr [OPTION]... HOST" + "nc:Netcat - read/write network connections | nc [OPTION]... [HOST] [PORT]" + "telnet:Connect to a host over Telnet | telnet [OPTION]... [HOST [PORT]]" + "sftp:Secure file transfer over SSH | sftp [OPTION]... USER@HOST" + "nmap:Network exploration and port scanner | nmap [OPTION]... TARGET..." + "arp:Show/manipulate the ARP cache | arp [OPTION]..." + "route:Show/manipulate the routing table | route [OPTION]..." + "tcpdump:Capture and analyze network traffic | tcpdump [OPTION]... [EXPRESSION]" + "iptables:Configure IPv4 packet filtering | iptables [OPTION]... CHAIN [RULE]" + "ethtool:Query/control network driver settings | ethtool [OPTION]... DEVICE" + "nmcli:Control NetworkManager from the CLI | nmcli [OPTION]... OBJECT {COMMAND}" + "hostname:Show or set the system hostname | hostname [OPTION]... [NAME]" + "whois:Look up domain/IP registration info | whois [OPTION]... OBJECT" + "ssh-keygen:Generate/manage SSH keys | ssh-keygen [OPTION]..." + + # System Info (extended) + "lscpu:Display CPU architecture information | lscpu [OPTION]..." + "lsblk:List block devices | lsblk [OPTION]... [DEVICE]..." + "lsusb:List USB devices | lsusb [OPTION]..." + "lspci:List PCI devices | lspci [OPTION]..." + "lsmod:Show status of kernel modules | lsmod" + "lsof:List open files and the processes using them | lsof [OPTION]..." + "vmstat:Report virtual memory statistics | vmstat [OPTION]... [DELAY [COUNT]]" + "iostat:Report CPU and I/O statistics | iostat [OPTION]... [DELAY [COUNT]]" + "dmidecode:Dump DMI/SMBIOS hardware table | dmidecode [OPTION]..." + "dmesg:Print kernel ring buffer messages | dmesg [OPTION]..." + "journalctl:Query the systemd journal | journalctl [OPTION]..." + "timedatectl:Query/change system clock settings | timedatectl [OPTION]... [COMMAND]" + "hostnamectl:Query/change system hostname | hostnamectl [OPTION]... [COMMAND]" + "nproc:Print the number of processing units | nproc [OPTION]..." + "sysctl:Read/modify kernel parameters | sysctl [OPTION]... [VARIABLE[=VALUE]]..." + + # Process Management (extended) + "nice:Run a program with modified priority | nice [OPTION]... [COMMAND]" + "renice:Alter priority of running processes | renice [OPTION]... PRIORITY PID..." + "nohup:Run a command immune to hangups | nohup COMMAND [ARG]..." + "disown:Remove jobs from the shell's job table | disown [OPTION]... [JOB]..." + "pgrep:Find process IDs by name/attributes | pgrep [OPTION]... PATTERN" + "pidof:Find the PID of a running program | pidof [OPTION]... PROGRAM..." + "fuser:Identify processes using files/sockets | fuser [OPTION]... NAME..." + "time:Time a command's execution | time [OPTION]... COMMAND" + "timeout:Run a command with a time limit | timeout [OPTION]... DURATION COMMAND" + "strace:Trace system calls and signals | strace [OPTION]... COMMAND" + "ltrace:Trace library calls | ltrace [OPTION]... COMMAND" + "at:Schedule a command for later | at [OPTION]... TIME" + "crontab:Manage cron job schedules | crontab [OPTION]... [FILE]" + "sleep:Pause for a specified duration | sleep NUMBER[SUFFIX]..." + + # System Control / Disk (extended) + "mount:Mount a filesystem | mount [OPTION]... DEVICE DIR" + "umount:Unmount a filesystem | umount [OPTION]... {DIR|DEVICE}" + "fdisk:Manipulate disk partition tables | fdisk [OPTION]... DEVICE" + "parted:Partition manipulation program | parted [OPTION]... [DEVICE [COMMAND]]" + "mkfs:Build a Linux filesystem | mkfs [OPTION]... DEVICE" + "fsck:Check and repair a filesystem | fsck [OPTION]... [DEVICE]..." + "swapon:Enable devices/files for swapping | swapon [OPTION]... [DEVICE]" + "swapoff:Disable swapping on devices/files | swapoff [OPTION]... [DEVICE]" + "blkid:Locate/print block device attributes | blkid [OPTION]... [DEVICE]..." + "sync:Flush filesystem buffers to disk | sync [OPTION]... [FILE]..." + "modprobe:Add or remove kernel modules | modprobe [OPTION]... MODULE" + "poweroff:Power off the machine | poweroff [OPTION]..." + "ncdu:NCurses disk usage analyzer | ncdu [OPTION]... [DIRECTORY]" + + # Package Management (extended) + "yum:Package manager (RHEL/CentOS) | yum [OPTION]... COMMAND" + "dnf:Package manager (Fedora/RHEL) | dnf [OPTION]... COMMAND" + "rpm:RPM package manager | rpm [OPTION]... PACKAGE..." + "pacman:Package manager (Arch Linux) | pacman [OPTION]... [TARGET]..." + "zypper:Package manager (openSUSE) | zypper [OPTION]... COMMAND" + "flatpak:Manage Flatpak applications | flatpak [OPTION]... COMMAND" + "pip:Python package installer | pip [OPTION]... COMMAND" + "npm:Node.js package manager | npm [OPTION]... COMMAND" + "apt-cache:Query the APT package cache | apt-cache [OPTION]... COMMAND" + + # User & Group Management (extended) + "usermod:Modify a user account | usermod [OPTION]... LOGIN" + "groupadd:Create a new group | groupadd [OPTION]... GROUP" + "groupdel:Delete a group | groupdel [OPTION]... GROUP" + "groupmod:Modify a group | groupmod [OPTION]... GROUP" + "groups:Show groups a user belongs to | groups [USER]..." + "id:Print user and group IDs | id [OPTION]... [USER]" + "chage:Change user password expiry info | chage [OPTION]... LOGIN" + "newgrp:Log in to a new group | newgrp [GROUP]" + "last:Show last logged-in users | last [OPTION]... [NAME]..." + "logname:Print the user's login name | logname" + + # Permissions & Security (extended) + "umask:Set default file permission mask | umask [OPTION]... [MODE]" + "chgrp:Change group ownership | chgrp [OPTION]... GROUP FILE..." + "setfacl:Set file access control lists | setfacl [OPTION]... FILE..." + "getfacl:Get file access control lists | getfacl [OPTION]... FILE..." + "chattr:Change file attributes on Linux FS | chattr [OPTION]... [+-=MODE] FILE..." + "lsattr:List file attributes on Linux FS | lsattr [OPTION]... [FILE]..." + "gpg:Encrypt, sign, and manage keys | gpg [OPTION]... [FILE]..." + "openssl:Cryptography and TLS toolkit | openssl COMMAND [OPTION]..." + "md5sum:Compute/check MD5 checksums | md5sum [OPTION]... [FILE]..." + "sha256sum:Compute/check SHA-256 checksums | sha256sum [OPTION]... [FILE]..." + "sha1sum:Compute/check SHA-1 checksums | sha1sum [OPTION]... [FILE]..." + "cksum:Compute CRC checksum and byte count | cksum [OPTION]... [FILE]..." + "base64:Encode/decode data in base64 | base64 [OPTION]... [FILE]" + + # Shell & Scripting (extended) + "read:Read a line into shell variables | read [OPTION]... [NAME]..." + "test:Evaluate a conditional expression | test EXPRESSION" + "eval:Evaluate arguments as a command | eval [ARG]..." + "exec:Replace the shell with a command | exec [COMMAND [ARG]...]" + "source:Execute commands from a file | source FILE [ARG]..." + "set:Set shell options and positional params | set [OPTION]... [ARG]..." + "unset:Unset shell variables or functions | unset [OPTION]... NAME..." + "shift:Shift positional parameters | shift [N]" + "getopts:Parse positional option arguments | getopts OPTSTRING NAME [ARG]..." + "declare:Declare variables and attributes | declare [OPTION]... [NAME[=VALUE]]..." + "trap:Run commands on signals/events | trap [OPTION]... [ARG] [SIGNAL]..." + "ulimit:Set/show user resource limits | ulimit [OPTION]... [LIMIT]" + "hash:Remember/show command locations | hash [OPTION]... [NAME]..." + "true:Return a successful exit status | true" + "false:Return an unsuccessful exit status | false" + "seq:Print a sequence of numbers | seq [OPTION]... [FIRST [INC]] LAST" + "yes:Repeatedly print a string | yes [STRING]..." + "expr:Evaluate expressions | expr EXPRESSION" + "bc:Arbitrary-precision calculator | bc [OPTION]... [FILE]..." + "shuf:Generate random permutations | shuf [OPTION]... [FILE]" + "factor:Print the prime factors of numbers | factor [NUMBER]..." + + # Terminal & Misc (extended) + "clear:Clear the terminal screen | clear [OPTION]..." + "reset:Reset the terminal to defaults | reset [OPTION]..." + "tput:Query/set terminal capabilities | tput [OPTION]... CAPNAME [ARG]..." + "stty:Change/print terminal line settings | stty [OPTION]... [SETTING]..." + "tty:Print the terminal connected to stdin | tty [OPTION]..." + "screen:Terminal multiplexer | screen [OPTION]... [COMMAND]" + "tmux:Terminal multiplexer | tmux [OPTION]... [COMMAND]" + "nano:Simple terminal text editor | nano [OPTION]... [FILE]..." + "vim:Vi IMproved text editor | vim [OPTION]... [FILE]..." + "xdg-open:Open a file/URL in the default app | xdg-open {FILE|URL}" + "notify-send:Send a desktop notification | notify-send [OPTION]... TITLE [BODY]" + "lolcat:Rainbow-colorize text output | lolcat [OPTION]... [FILE]..." + "figlet:Render text as ASCII art banners | figlet [OPTION]... [MESSAGE]" ) # Parse arguments diff --git a/commands-db.json b/commands-db.json index b6cefca..d660551 100644 --- a/commands-db.json +++ b/commands-db.json @@ -2,7 +2,14 @@ "tasks": [ { "id": "list-files-by-size", - "keywords": ["list", "files", "size", "largest", "biggest", "sort"], + "keywords": [ + "list", + "files", + "size", + "largest", + "biggest", + "sort" + ], "category": "files", "command": "ls -lhS", "description": "List files sorted by size (largest first)", @@ -20,7 +27,10 @@ "cmd": "ls -lhS | head -11" } ], - "related": ["find-large-files", "disk-usage"], + "related": [ + "find-large-files", + "disk-usage" + ], "flags_explained": { "-l": "Long format (detailed info)", "-h": "Human readable sizes (KB, MB, GB)", @@ -29,7 +39,16 @@ }, { "id": "find-large-files", - "keywords": ["find", "large", "big", "files", "disk", "space", "100mb", "size"], + "keywords": [ + "find", + "large", + "big", + "files", + "disk", + "space", + "100mb", + "size" + ], "category": "files", "command": "find . -type f -size +100M -exec ls -lh {} \\;", "description": "Find files larger than 100MB", @@ -47,7 +66,10 @@ "cmd": "find . -type f -size +100M -exec ls -lh {} \\; | sort -k5 -hr" } ], - "related": ["list-files-by-size", "disk-usage"], + "related": [ + "list-files-by-size", + "disk-usage" + ], "flags_explained": { "-type f": "Only files (not directories)", "-size +100M": "Size greater than 100 megabytes", @@ -56,7 +78,15 @@ }, { "id": "search-in-files", - "keywords": ["search", "grep", "find", "text", "pattern", "recursive", "content"], + "keywords": [ + "search", + "grep", + "find", + "text", + "pattern", + "recursive", + "content" + ], "category": "text", "command": "grep -r \"pattern\" .", "description": "Search for text pattern in files recursively", @@ -78,7 +108,10 @@ "cmd": "grep -r --include=\"*.log\" \"error\" ." } ], - "related": ["find-and-replace", "count-occurrences"], + "related": [ + "find-and-replace", + "count-occurrences" + ], "flags_explained": { "-r": "Recursive search in subdirectories", "-i": "Case-insensitive matching", @@ -87,7 +120,14 @@ }, { "id": "find-and-replace", - "keywords": ["replace", "sed", "find", "change", "substitute", "text"], + "keywords": [ + "replace", + "sed", + "find", + "change", + "substitute", + "text" + ], "category": "text", "command": "sed -i 's/old/new/g' file.txt", "description": "Find and replace text in files", @@ -105,7 +145,9 @@ "cmd": "sed -i.bak 's/old/new/g' file.txt" } ], - "related": ["search-in-files"], + "related": [ + "search-in-files" + ], "flags_explained": { "-i": "Edit files in-place", "s/old/new/g": "Substitute old with new globally", @@ -114,7 +156,15 @@ }, { "id": "compress-folder", - "keywords": ["compress", "archive", "tar", "gzip", "zip", "backup", "folder"], + "keywords": [ + "compress", + "archive", + "tar", + "gzip", + "zip", + "backup", + "folder" + ], "category": "files", "command": "tar -czf archive.tar.gz folder/", "description": "Compress a folder into tar.gz archive", @@ -132,7 +182,10 @@ "cmd": "tar -tzf archive.tar.gz" } ], - "related": ["extract-archive", "compress-files"], + "related": [ + "extract-archive", + "compress-files" + ], "flags_explained": { "-c": "Create archive", "-z": "Compress with gzip", @@ -143,8 +196,16 @@ }, { "id": "disk-usage", - "keywords": ["disk", "usage", "space", "du", "size", "directory", "how much"], - "category": "system", + "keywords": [ + "disk", + "usage", + "space", + "du", + "size", + "directory", + "how much" + ], + "category": "files", "command": "du -sh */", "description": "Show disk usage of directories", "examples": [ @@ -161,7 +222,10 @@ "cmd": "du -sh ." } ], - "related": ["find-large-files", "list-files-by-size"], + "related": [ + "find-large-files", + "list-files-by-size" + ], "flags_explained": { "-s": "Summary only (don't show subdirectories)", "-h": "Human readable sizes", @@ -170,7 +234,14 @@ }, { "id": "find-files-by-name", - "keywords": ["find", "files", "name", "search", "locate", "filename"], + "keywords": [ + "find", + "files", + "name", + "search", + "locate", + "filename" + ], "category": "files", "command": "find . -name \"*.txt\"", "description": "Find files by name pattern", @@ -188,7 +259,10 @@ "cmd": "find . -name \"*.txt\" -mtime 0" } ], - "related": ["search-in-files", "find-large-files"], + "related": [ + "search-in-files", + "find-large-files" + ], "flags_explained": { "-name": "Match by exact name pattern", "-iname": "Case-insensitive name matching", @@ -197,7 +271,15 @@ }, { "id": "monitor-cpu", - "keywords": ["cpu", "monitor", "top", "usage", "process", "performance", "watch"], + "keywords": [ + "cpu", + "monitor", + "top", + "usage", + "process", + "performance", + "watch" + ], "category": "system", "command": "top", "description": "Monitor CPU and process usage in real-time", @@ -215,7 +297,10 @@ "cmd": "ps aux --sort=-%cpu | head -10" } ], - "related": ["monitor-memory", "list-processes"], + "related": [ + "monitor-memory", + "list-processes" + ], "flags_explained": { "-b": "Batch mode (non-interactive)", "-n": "Number of iterations", @@ -224,7 +309,14 @@ }, { "id": "monitor-memory", - "keywords": ["memory", "ram", "usage", "free", "available", "monitor"], + "keywords": [ + "memory", + "ram", + "usage", + "free", + "available", + "monitor" + ], "category": "system", "command": "free -h", "description": "Display memory usage information", @@ -242,7 +334,10 @@ "cmd": "free -m" } ], - "related": ["monitor-cpu", "disk-usage"], + "related": [ + "monitor-cpu", + "disk-usage" + ], "flags_explained": { "-h": "Human readable (KB, MB, GB)", "-m": "Show in megabytes", @@ -251,7 +346,15 @@ }, { "id": "download-file", - "keywords": ["download", "wget", "curl", "file", "url", "http", "get"], + "keywords": [ + "download", + "wget", + "curl", + "file", + "url", + "http", + "get" + ], "category": "network", "command": "wget URL", "description": "Download file from URL", @@ -273,7 +376,10 @@ "cmd": "wget -c https://example.com/file.zip" } ], - "related": ["check-connectivity", "test-url"], + "related": [ + "check-connectivity", + "test-url" + ], "flags_explained": { "-O": "Save with different name", "-c": "Continue/resume download", @@ -282,7 +388,15 @@ }, { "id": "check-ports", - "keywords": ["port", "network", "listen", "netstat", "ss", "open", "check"], + "keywords": [ + "port", + "network", + "listen", + "netstat", + "ss", + "open", + "check" + ], "category": "network", "command": "ss -tulpn", "description": "Check which ports are open and listening", @@ -304,7 +418,10 @@ "cmd": "netstat -tulpn" } ], - "related": ["check-connectivity", "firewall-status"], + "related": [ + "check-connectivity", + "firewall-status" + ], "flags_explained": { "-t": "TCP ports", "-u": "UDP ports", @@ -315,7 +432,14 @@ }, { "id": "count-lines", - "keywords": ["count", "lines", "wc", "words", "characters", "file"], + "keywords": [ + "count", + "lines", + "wc", + "words", + "characters", + "file" + ], "category": "text", "command": "wc -l file.txt", "description": "Count lines, words, or characters in files", @@ -337,7 +461,9 @@ "cmd": "find . -name \"*.py\" -exec wc -l {} + | tail -1" } ], - "related": ["search-in-files"], + "related": [ + "search-in-files" + ], "flags_explained": { "-l": "Count lines", "-w": "Count words", @@ -346,7 +472,14 @@ }, { "id": "file-permissions", - "keywords": ["permissions", "chmod", "change", "access", "rights", "owner"], + "keywords": [ + "permissions", + "chmod", + "change", + "access", + "rights", + "owner" + ], "category": "files", "command": "chmod 755 file.sh", "description": "Change file permissions", @@ -368,7 +501,9 @@ "cmd": "ls -l file.sh" } ], - "related": ["change-owner"], + "related": [ + "change-owner" + ], "flags_explained": { "+x": "Add execute permission", "755": "rwxr-xr-x (owner: all, group: read+exec, others: read+exec)", @@ -377,7 +512,14 @@ }, { "id": "find-duplicates", - "keywords": ["duplicate", "files", "same", "find", "fdupes", "identical"], + "keywords": [ + "duplicate", + "files", + "same", + "find", + "fdupes", + "identical" + ], "category": "files", "command": "find . -type f -exec md5sum {} + | sort | uniq -w32 -dD", "description": "Find duplicate files by content", @@ -395,7 +537,10 @@ "cmd": "fdupes -r ." } ], - "related": ["find-files-by-name", "disk-usage"], + "related": [ + "find-files-by-name", + "disk-usage" + ], "flags_explained": { "md5sum": "Calculate file checksum", "uniq -d": "Show only duplicate lines", @@ -404,7 +549,14 @@ }, { "id": "process-kill", - "keywords": ["kill", "process", "stop", "terminate", "pid", "pkill"], + "keywords": [ + "kill", + "process", + "stop", + "terminate", + "pid", + "pkill" + ], "category": "system", "command": "kill PID", "description": "Stop/kill a running process", @@ -426,7 +578,10 @@ "cmd": "pkill -f \"python script.py\"" } ], - "related": ["list-processes", "monitor-cpu"], + "related": [ + "list-processes", + "monitor-cpu" + ], "flags_explained": { "-9": "Force kill (SIGKILL)", "pkill": "Kill by process name", @@ -435,7 +590,14 @@ }, { "id": "list-processes", - "keywords": ["process", "list", "ps", "running", "show", "all"], + "keywords": [ + "process", + "list", + "ps", + "running", + "show", + "all" + ], "category": "system", "command": "ps aux", "description": "List all running processes", @@ -457,7 +619,10 @@ "cmd": "ps aux --sort=-%mem | head -10" } ], - "related": ["monitor-cpu", "process-kill"], + "related": [ + "monitor-cpu", + "process-kill" + ], "flags_explained": { "a": "Show processes from all users", "u": "User-oriented format", @@ -466,7 +631,14 @@ }, { "id": "create-symlink", - "keywords": ["symlink", "link", "symbolic", "ln", "shortcut", "alias"], + "keywords": [ + "symlink", + "link", + "symbolic", + "ln", + "shortcut", + "alias" + ], "category": "files", "command": "ln -s /path/to/file link-name", "description": "Create symbolic link to file or directory", @@ -484,7 +656,9 @@ "cmd": "ls -l link-name" } ], - "related": ["file-permissions"], + "related": [ + "file-permissions" + ], "flags_explained": { "-s": "Create symbolic (soft) link", "-f": "Force (overwrite existing link)", @@ -493,7 +667,13 @@ }, { "id": "compare-files", - "keywords": ["compare", "diff", "difference", "files", "changes"], + "keywords": [ + "compare", + "diff", + "difference", + "files", + "changes" + ], "category": "text", "command": "diff file1.txt file2.txt", "description": "Compare two files and show differences", @@ -515,7 +695,9 @@ "cmd": "diff -r dir1/ dir2/" } ], - "related": ["find-duplicates"], + "related": [ + "find-duplicates" + ], "flags_explained": { "-y": "Side-by-side output", "-u": "Unified format (easier to read)", @@ -524,7 +706,14 @@ }, { "id": "check-connectivity", - "keywords": ["ping", "network", "connectivity", "test", "connection", "reachable"], + "keywords": [ + "ping", + "network", + "connectivity", + "test", + "connection", + "reachable" + ], "category": "network", "command": "ping google.com", "description": "Test network connectivity to host", @@ -542,7 +731,10 @@ "cmd": "ping 8.8.8.8" } ], - "related": ["check-ports", "download-file"], + "related": [ + "check-ports", + "download-file" + ], "flags_explained": { "-c": "Count (number of packets to send)", "-i": "Interval between packets in seconds" @@ -550,7 +742,14 @@ }, { "id": "watch-command", - "keywords": ["watch", "repeat", "monitor", "refresh", "continuously", "auto"], + "keywords": [ + "watch", + "repeat", + "monitor", + "refresh", + "continuously", + "auto" + ], "category": "system", "command": "watch -n 2 command", "description": "Execute command repeatedly and display results", @@ -568,7 +767,10 @@ "cmd": "watch -d -n 1 'ps aux | grep firefox'" } ], - "related": ["monitor-cpu", "monitor-memory"], + "related": [ + "monitor-cpu", + "monitor-memory" + ], "flags_explained": { "-n": "Interval in seconds", "-d": "Highlight differences between updates" @@ -576,7 +778,14 @@ }, { "id": "extract-archive", - "keywords": ["extract", "unzip", "decompress", "tar", "archive", "unpack"], + "keywords": [ + "extract", + "unzip", + "decompress", + "tar", + "archive", + "unpack" + ], "category": "files", "command": "tar -xzf archive.tar.gz", "description": "Extract compressed archive files", @@ -598,31 +807,2321 @@ "cmd": "tar -xjf archive.tar.bz2" } ], - "related": ["compress-folder"], + "related": [ + "compress-folder" + ], "flags_explained": { "-x": "Extract archive", "-z": "Decompress gzip", "-j": "Decompress bzip2", "-C": "Change to directory before extracting" } + }, + { + "id": "copy-files", + "keywords": [ + "copy", + "cp", + "duplicate", + "files", + "clone", + "backup" + ], + "category": "files", + "command": "cp -r source/ dest/", + "description": "Copy files and directories", + "examples": [ + { + "desc": "Copy a single file", + "cmd": "cp file.txt backup.txt" + }, + { + "desc": "Copy a directory recursively", + "cmd": "cp -r src/ dest/" + }, + { + "desc": "Copy preserving all attributes", + "cmd": "cp -a src/ dest/" + }, + { + "desc": "Copy only when source is newer", + "cmd": "cp -u file.txt dest/" + } + ], + "related": [ + "move-rename", + "sync-directories" + ], + "flags_explained": { + "-r": "Recursive (copy directories)", + "-a": "Archive mode (preserve all attributes)", + "-u": "Update (copy only when source is newer)", + "-v": "Verbose (show each file copied)" + } + }, + { + "id": "move-rename", + "keywords": [ + "move", + "rename", + "mv", + "relocate", + "files" + ], + "category": "files", + "command": "mv old.txt new.txt", + "description": "Move or rename files and directories", + "examples": [ + { + "desc": "Rename a file", + "cmd": "mv old.txt new.txt" + }, + { + "desc": "Move a file into a directory", + "cmd": "mv file.txt dir/" + }, + { + "desc": "Move multiple files", + "cmd": "mv *.txt archive/" + }, + { + "desc": "Prompt before overwriting", + "cmd": "mv -i file.txt dest/" + } + ], + "related": [ + "copy-files", + "delete-files" + ], + "flags_explained": { + "-i": "Interactive (prompt before overwrite)", + "-n": "No-clobber (never overwrite existing)", + "-v": "Verbose (show each move)" + } + }, + { + "id": "delete-files", + "keywords": [ + "delete", + "remove", + "rm", + "erase", + "files", + "directory" + ], + "category": "files", + "command": "rm file.txt", + "description": "Delete files and directories", + "examples": [ + { + "desc": "Delete a file", + "cmd": "rm file.txt" + }, + { + "desc": "Delete a directory and its contents", + "cmd": "rm -r dir/" + }, + { + "desc": "Prompt before each deletion", + "cmd": "rm -i *.txt" + }, + { + "desc": "Force delete without prompts", + "cmd": "rm -rf dir/" + } + ], + "related": [ + "move-rename", + "find-files-by-name" + ], + "flags_explained": { + "-r": "Recursive (delete directories)", + "-f": "Force (ignore nonexistent, never prompt)", + "-i": "Interactive (prompt before each delete)", + "-v": "Verbose (show each file deleted)" + } + }, + { + "id": "create-directory", + "keywords": [ + "create", + "directory", + "folder", + "mkdir", + "make", + "new" + ], + "category": "files", + "command": "mkdir new-folder", + "description": "Create new directories", + "examples": [ + { + "desc": "Create a directory", + "cmd": "mkdir project" + }, + { + "desc": "Create nested directories", + "cmd": "mkdir -p a/b/c" + }, + { + "desc": "Create multiple directories", + "cmd": "mkdir src tests docs" + }, + { + "desc": "Set permissions on creation", + "cmd": "mkdir -m 700 private" + } + ], + "related": [ + "copy-files", + "file-permissions" + ], + "flags_explained": { + "-p": "Create parent directories as needed (no error if existing)", + "-m": "Set permission mode on the new directory", + "-v": "Verbose (print each created directory)" + } + }, + { + "id": "change-ownership", + "keywords": [ + "owner", + "ownership", + "chown", + "group", + "user", + "permissions" + ], + "category": "files", + "command": "chown user:group file.txt", + "description": "Change file owner and group", + "examples": [ + { + "desc": "Change owner of a file", + "cmd": "chown alice file.txt" + }, + { + "desc": "Change owner and group", + "cmd": "chown alice:devs file.txt" + }, + { + "desc": "Change recursively", + "cmd": "chown -R alice:devs project/" + }, + { + "desc": "Change group only", + "cmd": "chown :devs file.txt" + } + ], + "related": [ + "file-permissions" + ], + "flags_explained": { + "-R": "Recursive (apply to all files in directory)", + "user:group": "Set both owner and group", + "-v": "Verbose (report changes)" + } + }, + { + "id": "sync-directories", + "keywords": [ + "sync", + "rsync", + "mirror", + "backup", + "copy", + "incremental" + ], + "category": "files", + "command": "rsync -av source/ dest/", + "description": "Synchronize directories efficiently", + "examples": [ + { + "desc": "Sync a directory locally", + "cmd": "rsync -av src/ dest/" + }, + { + "desc": "Sync to a remote host over SSH", + "cmd": "rsync -av src/ user@host:/path/" + }, + { + "desc": "Mirror (delete extras in dest)", + "cmd": "rsync -av --delete src/ dest/" + }, + { + "desc": "Show progress during transfer", + "cmd": "rsync -av --progress src/ dest/" + } + ], + "related": [ + "copy-files", + "compress-folder" + ], + "flags_explained": { + "-a": "Archive mode (recursive, preserve attributes)", + "-v": "Verbose output", + "--delete": "Delete files in dest not present in source", + "--progress": "Show transfer progress per file" + } + }, + { + "id": "find-recent-files", + "keywords": [ + "recent", + "modified", + "newest", + "find", + "files", + "today", + "changed" + ], + "category": "files", + "command": "find . -type f -mtime -1", + "description": "Find recently modified files", + "examples": [ + { + "desc": "Files modified in the last 24 hours", + "cmd": "find . -type f -mtime -1" + }, + { + "desc": "Files modified in the last 7 days", + "cmd": "find . -type f -mtime -7" + }, + { + "desc": "Files modified in the last 30 minutes", + "cmd": "find . -type f -mmin -30" + }, + { + "desc": "List newest files by time", + "cmd": "ls -lt | head" + } + ], + "related": [ + "find-files-by-name", + "find-large-files" + ], + "flags_explained": { + "-mtime -1": "Modified less than 1 day ago", + "-mmin -30": "Modified less than 30 minutes ago", + "-type f": "Only files (not directories)" + } + }, + { + "id": "find-empty-dirs", + "keywords": [ + "empty", + "directories", + "folders", + "find", + "delete", + "clean" + ], + "category": "files", + "command": "find . -type d -empty", + "description": "Find and remove empty directories", + "examples": [ + { + "desc": "Find empty directories", + "cmd": "find . -type d -empty" + }, + { + "desc": "Find empty files", + "cmd": "find . -type f -empty" + }, + { + "desc": "Delete empty directories", + "cmd": "find . -type d -empty -delete" + } + ], + "related": [ + "find-files-by-name", + "delete-files" + ], + "flags_explained": { + "-type d": "Only directories", + "-empty": "Match empty files/directories", + "-delete": "Delete matched entries" + } + }, + { + "id": "sort-lines", + "keywords": [ + "sort", + "order", + "arrange", + "lines", + "alphabetical", + "numeric" + ], + "category": "text", + "command": "sort file.txt", + "description": "Sort lines of text in a file", + "examples": [ + { + "desc": "Sort alphabetically", + "cmd": "sort file.txt" + }, + { + "desc": "Sort numerically", + "cmd": "sort -n numbers.txt" + }, + { + "desc": "Sort in reverse order", + "cmd": "sort -r file.txt" + }, + { + "desc": "Sort and remove duplicates", + "cmd": "sort -u file.txt" + } + ], + "related": [ + "unique-lines", + "count-lines" + ], + "flags_explained": { + "-n": "Numeric sort (treat values as numbers)", + "-r": "Reverse the sort order", + "-u": "Output only unique lines", + "-k": "Sort by a specific field/column" + } + }, + { + "id": "unique-lines", + "keywords": [ + "unique", + "duplicate", + "uniq", + "distinct", + "deduplicate", + "count" + ], + "category": "text", + "command": "sort file.txt | uniq", + "description": "Filter or count repeated lines", + "examples": [ + { + "desc": "Remove duplicate lines", + "cmd": "sort file.txt | uniq" + }, + { + "desc": "Count occurrences of each line", + "cmd": "sort file.txt | uniq -c" + }, + { + "desc": "Show only duplicated lines", + "cmd": "sort file.txt | uniq -d" + }, + { + "desc": "Show only unique (non-repeated) lines", + "cmd": "sort file.txt | uniq -u" + } + ], + "related": [ + "sort-lines", + "word-frequency" + ], + "flags_explained": { + "-c": "Prefix each line with its count", + "-d": "Only print duplicated lines", + "-u": "Only print lines that are not repeated" + } + }, + { + "id": "extract-columns", + "keywords": [ + "columns", + "fields", + "awk", + "extract", + "print", + "select" + ], + "category": "text", + "command": "awk '{print $1}' file.txt", + "description": "Extract columns or fields from text", + "examples": [ + { + "desc": "Print the first column", + "cmd": "awk '{print $1}' file.txt" + }, + { + "desc": "Print first and third columns", + "cmd": "awk '{print $1, $3}' file.txt" + }, + { + "desc": "Use a custom delimiter (CSV)", + "cmd": "awk -F',' '{print $2}' data.csv" + }, + { + "desc": "Cut by character delimiter", + "cmd": "cut -d',' -f1 data.csv" + } + ], + "related": [ + "search-in-files", + "find-and-replace" + ], + "flags_explained": { + "$1": "Reference to the first field/column", + "-F','": "Set the input field separator to a comma", + "print": "Output the selected fields", + "cut -d -f": "Cut by delimiter and select fields" + } + }, + { + "id": "view-file", + "keywords": [ + "view", + "read", + "display", + "less", + "head", + "tail", + "page" + ], + "category": "text", + "command": "less file.txt", + "description": "View file contents with paging", + "examples": [ + { + "desc": "Page through a file", + "cmd": "less file.txt" + }, + { + "desc": "Show the first 20 lines", + "cmd": "head -20 file.txt" + }, + { + "desc": "Show the last 20 lines", + "cmd": "tail -20 file.txt" + }, + { + "desc": "Follow a log file live", + "cmd": "tail -f /var/log/syslog" + } + ], + "related": [ + "count-lines", + "search-in-files" + ], + "flags_explained": { + "head -N": "Show the first N lines", + "tail -N": "Show the last N lines", + "tail -f": "Follow file as it grows (live updates)" + } + }, + { + "id": "json-query", + "keywords": [ + "json", + "jq", + "parse", + "query", + "extract", + "api", + "data" + ], + "category": "text", + "command": "jq '.key' file.json", + "description": "Parse and query JSON data", + "examples": [ + { + "desc": "Extract a top-level field", + "cmd": "jq '.name' file.json" + }, + { + "desc": "Extract a nested field", + "cmd": "jq '.user.email' file.json" + }, + { + "desc": "List array elements", + "cmd": "jq '.items[]' file.json" + }, + { + "desc": "Pretty-print JSON from an API", + "cmd": "curl -s URL | jq ." + } + ], + "related": [ + "search-in-files", + "check-website" + ], + "flags_explained": { + ".key": "Select the value of a field", + ".[]": "Iterate over array elements", + "-r": "Raw output (no JSON quotes)", + ".": "Identity filter (pretty-print whole input)" + } + }, + { + "id": "word-frequency", + "keywords": [ + "frequency", + "count", + "words", + "occurrences", + "most", + "common", + "histogram" + ], + "category": "text", + "command": "tr ' ' '\\n' < file.txt | sort | uniq -c | sort -nr", + "description": "Count word or value frequency", + "examples": [ + { + "desc": "Most common words in a file", + "cmd": "tr ' ' '\\n' < file.txt | sort | uniq -c | sort -nr" + }, + { + "desc": "Top 10 most frequent lines", + "cmd": "sort file.txt | uniq -c | sort -nr | head -10" + }, + { + "desc": "Count matches of a pattern", + "cmd": "grep -o 'error' file.log | wc -l" + } + ], + "related": [ + "unique-lines", + "count-lines" + ], + "flags_explained": { + "tr ' ' '\\n'": "Split words onto separate lines", + "uniq -c": "Count occurrences of each line", + "sort -nr": "Sort by count, highest first" + } + }, + { + "id": "dns-lookup", + "keywords": [ + "dns", + "dig", + "nslookup", + "domain", + "resolve", + "lookup", + "records" + ], + "category": "network", + "command": "dig example.com", + "description": "Look up DNS records for a domain", + "examples": [ + { + "desc": "Look up A records", + "cmd": "dig example.com" + }, + { + "desc": "Short answer only", + "cmd": "dig +short example.com" + }, + { + "desc": "Look up MX (mail) records", + "cmd": "dig example.com MX" + }, + { + "desc": "Reverse DNS lookup", + "cmd": "dig -x 8.8.8.8" + } + ], + "related": [ + "check-connectivity", + "check-website" + ], + "flags_explained": { + "+short": "Show only the concise answer", + "MX": "Query mail-exchange records", + "-x": "Perform a reverse (PTR) lookup" + } + }, + { + "id": "copy-to-remote", + "keywords": [ + "scp", + "copy", + "remote", + "transfer", + "upload", + "download", + "ssh" + ], + "category": "network", + "command": "scp file.txt user@host:/path/", + "description": "Copy files to or from a remote host", + "examples": [ + { + "desc": "Upload a file to a server", + "cmd": "scp file.txt user@host:/path/" + }, + { + "desc": "Download a file from a server", + "cmd": "scp user@host:/path/file.txt ." + }, + { + "desc": "Copy a directory recursively", + "cmd": "scp -r dir/ user@host:/path/" + }, + { + "desc": "Use a specific SSH port", + "cmd": "scp -P 2222 file.txt user@host:/path/" + } + ], + "related": [ + "sync-directories", + "download-file" + ], + "flags_explained": { + "-r": "Recursive (copy directories)", + "-P": "Specify the remote SSH port", + "-C": "Enable compression during transfer" + } + }, + { + "id": "check-website", + "keywords": [ + "website", + "http", + "status", + "curl", + "headers", + "url", + "test" + ], + "category": "network", + "command": "curl -I https://example.com", + "description": "Check a website's status and headers", + "examples": [ + { + "desc": "Show response headers only", + "cmd": "curl -I https://example.com" + }, + { + "desc": "Show only the HTTP status code", + "cmd": "curl -o /dev/null -s -w '%{http_code}\\n' https://example.com" + }, + { + "desc": "Follow redirects", + "cmd": "curl -IL https://example.com" + }, + { + "desc": "Measure total response time", + "cmd": "curl -o /dev/null -s -w '%{time_total}\\n' https://example.com" + } + ], + "related": [ + "download-file", + "check-connectivity" + ], + "flags_explained": { + "-I": "Fetch headers only (HEAD request)", + "-L": "Follow redirects", + "-s": "Silent mode (no progress meter)", + "-w": "Write out custom info (e.g. status code)" + } + }, + { + "id": "public-ip", + "keywords": [ + "ip", + "public", + "address", + "external", + "myip", + "network" + ], + "category": "network", + "command": "curl -s ifconfig.me", + "description": "Find your public and local IP addresses", + "examples": [ + { + "desc": "Show your public IP", + "cmd": "curl -s ifconfig.me" + }, + { + "desc": "Alternative public IP service", + "cmd": "curl -s https://api.ipify.org" + }, + { + "desc": "Show local IP addresses", + "cmd": "ip addr show" + }, + { + "desc": "Show default gateway", + "cmd": "ip route | grep default" + } + ], + "related": [ + "check-connectivity", + "check-ports" + ], + "flags_explained": { + "-s": "Silent mode (suppress progress output)", + "ip addr": "Show network interface addresses", + "ip route": "Show the routing table" + } + }, + { + "id": "disk-free", + "keywords": [ + "disk", + "free", + "space", + "df", + "available", + "filesystem", + "mount" + ], + "category": "system", + "command": "df -h", + "description": "Show available disk space on filesystems", + "examples": [ + { + "desc": "Show disk usage human-readable", + "cmd": "df -h" + }, + { + "desc": "Show filesystem types", + "cmd": "df -hT" + }, + { + "desc": "Show usage for current directory", + "cmd": "df -h ." + }, + { + "desc": "Show inode usage", + "cmd": "df -i" + } + ], + "related": [ + "disk-usage", + "find-large-files" + ], + "flags_explained": { + "-h": "Human-readable sizes (KB, MB, GB)", + "-T": "Show the filesystem type", + "-i": "Show inode information instead of blocks" + } + }, + { + "id": "system-uptime", + "keywords": [ + "uptime", + "load", + "running", + "system", + "boot", + "how long" + ], + "category": "system", + "command": "uptime", + "description": "Show system uptime and load average", + "examples": [ + { + "desc": "Show uptime and load", + "cmd": "uptime" + }, + { + "desc": "Pretty uptime format", + "cmd": "uptime -p" + }, + { + "desc": "Show when the system booted", + "cmd": "uptime -s" + }, + { + "desc": "Show last reboot times", + "cmd": "last reboot | head" + } + ], + "related": [ + "monitor-cpu", + "monitor-memory" + ], + "flags_explained": { + "-p": "Pretty format (e.g. 'up 3 hours')", + "-s": "Show system boot time", + "load average": "Avg processes waiting over 1/5/15 minutes" + } + }, + { + "id": "service-status", + "keywords": [ + "service", + "systemctl", + "status", + "start", + "stop", + "restart", + "daemon" + ], + "category": "system", + "command": "systemctl status nginx", + "description": "Manage and inspect system services", + "examples": [ + { + "desc": "Check a service's status", + "cmd": "systemctl status nginx" + }, + { + "desc": "Start a service", + "cmd": "sudo systemctl start nginx" + }, + { + "desc": "Restart a service", + "cmd": "sudo systemctl restart nginx" + }, + { + "desc": "Enable a service at boot", + "cmd": "sudo systemctl enable nginx" + } + ], + "related": [ + "view-logs", + "list-processes" + ], + "flags_explained": { + "status": "Show whether a service is running", + "start/stop": "Start or stop the service now", + "restart": "Stop then start the service", + "enable/disable": "Control whether it starts at boot" + } + }, + { + "id": "view-logs", + "keywords": [ + "logs", + "journalctl", + "systemd", + "errors", + "syslog", + "debug" + ], + "category": "system", + "command": "journalctl -xe", + "description": "View and follow system logs", + "examples": [ + { + "desc": "Show recent log entries", + "cmd": "journalctl -xe" + }, + { + "desc": "Follow logs live", + "cmd": "journalctl -f" + }, + { + "desc": "Logs for a specific service", + "cmd": "journalctl -u nginx" + }, + { + "desc": "Logs since boot", + "cmd": "journalctl -b" + } + ], + "related": [ + "service-status", + "kernel-messages" + ], + "flags_explained": { + "-f": "Follow (live tail) new log entries", + "-u": "Filter by systemd unit/service", + "-b": "Show logs from the current boot", + "-xe": "Add explanations and jump to the end" + } + }, + { + "id": "find-process-by-port", + "keywords": [ + "port", + "process", + "lsof", + "which", + "using", + "pid", + "listening" + ], + "category": "system", + "command": "lsof -i :8080", + "description": "Find which process is using a port", + "examples": [ + { + "desc": "Find process on a port", + "cmd": "lsof -i :8080" + }, + { + "desc": "Alternative using ss", + "cmd": "ss -tulpn | grep :8080" + }, + { + "desc": "Find files opened by a process", + "cmd": "lsof -p 1234" + }, + { + "desc": "Kill the process using a port", + "cmd": "kill $(lsof -t -i :8080)" + } + ], + "related": [ + "check-ports", + "process-kill" + ], + "flags_explained": { + "-i :PORT": "Show processes using a network port", + "-p PID": "List files opened by a specific process", + "-t": "Terse output (PIDs only, for scripting)" + } + }, + { + "id": "schedule-cron", + "keywords": [ + "cron", + "crontab", + "schedule", + "job", + "automate", + "periodic", + "task" + ], + "category": "system", + "command": "crontab -e", + "description": "Schedule recurring tasks with cron", + "examples": [ + { + "desc": "Edit your crontab", + "cmd": "crontab -e" + }, + { + "desc": "List your scheduled jobs", + "cmd": "crontab -l" + }, + { + "desc": "Run a script every day at 2am", + "cmd": "0 2 * * * /path/to/script.sh" + }, + { + "desc": "Run a one-off task later", + "cmd": "echo 'task.sh' | at now + 1 hour" + } + ], + "related": [ + "watch-command", + "service-status" + ], + "flags_explained": { + "-e": "Edit the current user's crontab", + "-l": "List the current user's cron jobs", + "* * * * *": "min hour day-of-month month day-of-week", + "at": "Schedule a single future command" + } + }, + { + "id": "cpu-info", + "keywords": [ + "cpu", + "cores", + "processor", + "lscpu", + "hardware", + "info", + "architecture" + ], + "category": "system", + "command": "lscpu", + "description": "Show CPU and hardware information", + "examples": [ + { + "desc": "Show CPU architecture details", + "cmd": "lscpu" + }, + { + "desc": "Count the number of cores", + "cmd": "nproc" + }, + { + "desc": "Show memory and CPU summary", + "cmd": "free -h && lscpu | head" + }, + { + "desc": "List block devices", + "cmd": "lsblk" + } + ], + "related": [ + "monitor-cpu", + "monitor-memory" + ], + "flags_explained": { + "lscpu": "Display CPU architecture from sysfs", + "nproc": "Print the number of processing units", + "lsblk": "List block storage devices" + } + }, + { + "id": "kernel-messages", + "keywords": [ + "dmesg", + "kernel", + "messages", + "hardware", + "boot", + "driver", + "errors" + ], + "category": "system", + "command": "dmesg", + "description": "View kernel ring buffer messages", + "examples": [ + { + "desc": "Show kernel messages", + "cmd": "dmesg" + }, + { + "desc": "Human-readable timestamps", + "cmd": "dmesg -T" + }, + { + "desc": "Follow new kernel messages", + "cmd": "dmesg -w" + }, + { + "desc": "Filter for USB events", + "cmd": "dmesg | grep -i usb" + } + ], + "related": [ + "view-logs", + "service-status" + ], + "flags_explained": { + "-T": "Show human-readable timestamps", + "-w": "Wait and follow new messages", + "-l": "Restrict output to given log levels" + } + }, + { + "id": "git-status", + "keywords": [ + "git", + "status", + "changes", + "staged", + "modified", + "version", + "control" + ], + "category": "git", + "command": "git status", + "description": "Show the working tree status", + "examples": [ + { + "desc": "Show changed and staged files", + "cmd": "git status" + }, + { + "desc": "Short status format", + "cmd": "git status -s" + }, + { + "desc": "Show changes vs last commit", + "cmd": "git diff" + }, + { + "desc": "Show staged changes", + "cmd": "git diff --staged" + } + ], + "related": [ + "git-log", + "git-discard" + ], + "flags_explained": { + "-s": "Short, compact status output", + "git diff": "Show unstaged line-by-line changes", + "--staged": "Show changes already staged for commit" + } + }, + { + "id": "git-log", + "keywords": [ + "git", + "log", + "history", + "commits", + "graph", + "version", + "control" + ], + "category": "git", + "command": "git log --oneline", + "description": "View commit history", + "examples": [ + { + "desc": "Compact one-line history", + "cmd": "git log --oneline" + }, + { + "desc": "Show a branch graph", + "cmd": "git log --oneline --graph --all" + }, + { + "desc": "Last 5 commits", + "cmd": "git log -5" + }, + { + "desc": "Commits by an author", + "cmd": "git log --author='Alice'" + } + ], + "related": [ + "git-status", + "git-discard" + ], + "flags_explained": { + "--oneline": "One commit per line (short hash + subject)", + "--graph": "Draw an ASCII commit graph", + "--all": "Include all branches", + "--author": "Filter commits by author" + } + }, + { + "id": "git-discard", + "keywords": [ + "git", + "discard", + "undo", + "revert", + "reset", + "restore", + "changes" + ], + "category": "git", + "command": "git restore file.txt", + "description": "Undo or discard local changes", + "examples": [ + { + "desc": "Discard changes to a file", + "cmd": "git restore file.txt" + }, + { + "desc": "Unstage a file", + "cmd": "git restore --staged file.txt" + }, + { + "desc": "Discard all uncommitted changes", + "cmd": "git checkout ." + }, + { + "desc": "Undo the last commit (keep changes)", + "cmd": "git reset --soft HEAD~1" + } + ], + "related": [ + "git-status", + "git-log" + ], + "flags_explained": { + "restore": "Restore a file to its committed state", + "--staged": "Move a file out of the staging area", + "reset --soft HEAD~1": "Undo last commit, keep changes staged" + } + }, + { + "id": "current-user", + "keywords": [ + "user", + "whoami", + "id", + "current", + "username", + "groups", + "uid" + ], + "category": "users", + "command": "whoami", + "description": "Show information about the current user", + "examples": [ + { + "desc": "Print the current username", + "cmd": "whoami" + }, + { + "desc": "Show user and group IDs", + "cmd": "id" + }, + { + "desc": "List groups you belong to", + "cmd": "groups" + }, + { + "desc": "Show your home and shell", + "cmd": "echo $HOME $SHELL" + } + ], + "related": [ + "who-logged-in", + "file-permissions" + ], + "flags_explained": { + "whoami": "Print the effective username", + "id": "Print user and group IDs", + "groups": "List the groups the user belongs to" + } + }, + { + "id": "who-logged-in", + "keywords": [ + "who", + "logged", + "users", + "online", + "sessions", + "w", + "login" + ], + "category": "users", + "command": "who", + "description": "Show who is currently logged in", + "examples": [ + { + "desc": "List logged-in users", + "cmd": "who" + }, + { + "desc": "Show users and what they're doing", + "cmd": "w" + }, + { + "desc": "Show recent login history", + "cmd": "last | head" + }, + { + "desc": "Count logged-in users", + "cmd": "who | wc -l" + } + ], + "related": [ + "current-user", + "list-processes" + ], + "flags_explained": { + "who": "List currently logged-in users", + "w": "Show users plus their active processes", + "last": "Show a history of logins" + } + }, + { + "id": "git-commit", + "keywords": [ + "commit", + "save", + "record", + "changes", + "stage" + ], + "category": "git", + "command": "git commit -m \"message\"", + "description": "Record staged changes to the repository", + "examples": [ + { + "desc": "Stage all and commit", + "cmd": "git commit -am \"message\"" + }, + { + "desc": "Commit specific files", + "cmd": "git add file.txt && git commit -m \"msg\"" + }, + { + "desc": "Amend last commit", + "cmd": "git commit --amend" + } + ], + "related": [ + "git-status", + "git-push", + "git-discard" + ], + "flags_explained": { + "-m": "Commit message inline", + "-a": "Auto-stage all tracked modified files", + "--amend": "Replace the previous commit" + } + }, + { + "id": "git-branch", + "keywords": [ + "branch", + "branches", + "list", + "create", + "new" + ], + "category": "git", + "command": "git branch", + "description": "List, create, or delete branches", + "examples": [ + { + "desc": "List local branches", + "cmd": "git branch" + }, + { + "desc": "Create a branch", + "cmd": "git branch feature-x" + }, + { + "desc": "Delete a branch", + "cmd": "git branch -d feature-x" + } + ], + "related": [ + "git-checkout", + "git-merge" + ], + "flags_explained": { + "-a": "List all branches incl. remote", + "-d": "Delete a merged branch", + "-D": "Force-delete a branch" + } + }, + { + "id": "git-checkout", + "keywords": [ + "checkout", + "switch", + "branch", + "change", + "move" + ], + "category": "git", + "command": "git switch branch-name", + "description": "Switch to a different branch (modern: git switch)", + "examples": [ + { + "desc": "Switch branch", + "cmd": "git switch main" + }, + { + "desc": "Create and switch", + "cmd": "git switch -c new-feature" + }, + { + "desc": "Legacy syntax", + "cmd": "git checkout main" + } + ], + "related": [ + "git-branch", + "git-merge" + ], + "flags_explained": { + "-c": "Create the branch then switch to it", + "-": "Switch to previous branch (git switch -)" + } + }, + { + "id": "git-merge", + "keywords": [ + "merge", + "combine", + "integrate", + "join", + "branch" + ], + "category": "git", + "command": "git merge branch-name", + "description": "Merge another branch into the current branch", + "examples": [ + { + "desc": "Merge a feature branch", + "cmd": "git merge feature-x" + }, + { + "desc": "Merge without fast-forward", + "cmd": "git merge --no-ff feature-x" + }, + { + "desc": "Abort a conflicted merge", + "cmd": "git merge --abort" + } + ], + "related": [ + "git-branch", + "git-checkout" + ], + "flags_explained": { + "--no-ff": "Always create a merge commit", + "--abort": "Cancel and restore pre-merge state", + "--squash": "Combine into a single staged change" + } + }, + { + "id": "git-stash", + "keywords": [ + "stash", + "shelve", + "save", + "temporary", + "wip" + ], + "category": "git", + "command": "git stash", + "description": "Temporarily shelve uncommitted changes", + "examples": [ + { + "desc": "Stash changes", + "cmd": "git stash" + }, + { + "desc": "Restore last stash", + "cmd": "git stash pop" + }, + { + "desc": "List stashes", + "cmd": "git stash list" + } + ], + "related": [ + "git-status", + "git-discard" + ], + "flags_explained": { + "pop": "Apply and remove the latest stash", + "list": "Show all stashes", + "-u": "Include untracked files" + } + }, + { + "id": "git-diff", + "keywords": [ + "diff", + "changes", + "compare", + "difference", + "modified" + ], + "category": "git", + "command": "git diff", + "description": "Show changes between commits, working tree, and index", + "examples": [ + { + "desc": "Unstaged changes", + "cmd": "git diff" + }, + { + "desc": "Staged changes", + "cmd": "git diff --staged" + }, + { + "desc": "Between branches", + "cmd": "git diff main..feature" + } + ], + "related": [ + "git-status", + "git-log" + ], + "flags_explained": { + "--staged": "Show staged (cached) changes", + "--stat": "Summary of changed files", + "--name-only": "Only file names" + } + }, + { + "id": "git-clone", + "keywords": [ + "clone", + "download", + "copy", + "repository", + "repo" + ], + "category": "git", + "command": "git clone ", + "description": "Clone a repository into a new directory", + "examples": [ + { + "desc": "Clone a repo", + "cmd": "git clone https://github.com/user/repo.git" + }, + { + "desc": "Shallow clone", + "cmd": "git clone --depth 1 " + }, + { + "desc": "Clone to a named dir", + "cmd": "git clone mydir" + } + ], + "related": [ + "git-pull", + "git-remote" + ], + "flags_explained": { + "--depth": "Limit history to N commits (shallow)", + "--branch": "Clone a specific branch", + "-b": "Short for --branch" + } + }, + { + "id": "git-pull", + "keywords": [ + "pull", + "fetch", + "update", + "sync", + "download" + ], + "category": "git", + "command": "git pull", + "description": "Fetch from remote and integrate into current branch", + "examples": [ + { + "desc": "Pull current branch", + "cmd": "git pull" + }, + { + "desc": "Pull with rebase", + "cmd": "git pull --rebase" + }, + { + "desc": "Pull a specific remote/branch", + "cmd": "git pull origin main" + } + ], + "related": [ + "git-push", + "git-clone" + ], + "flags_explained": { + "--rebase": "Rebase local commits onto fetched head instead of merging", + "--ff-only": "Refuse if a merge commit would be needed" + } + }, + { + "id": "git-push", + "keywords": [ + "push", + "upload", + "publish", + "send", + "remote" + ], + "category": "git", + "command": "git push", + "description": "Upload local commits to the remote repository", + "examples": [ + { + "desc": "Push current branch", + "cmd": "git push" + }, + { + "desc": "Push and set upstream", + "cmd": "git push -u origin feature-x" + }, + { + "desc": "Push tags", + "cmd": "git push --tags" + } + ], + "related": [ + "git-pull", + "git-commit" + ], + "flags_explained": { + "-u": "Set upstream tracking for the branch", + "--tags": "Push tags too", + "--force-with-lease": "Safer force push" + } + }, + { + "id": "git-undo-commit", + "keywords": [ + "undo", + "revert", + "reset", + "uncommit", + "rollback" + ], + "category": "git", + "command": "git reset --soft HEAD~1", + "description": "Undo the last commit but keep the changes staged", + "examples": [ + { + "desc": "Undo commit, keep changes staged", + "cmd": "git reset --soft HEAD~1" + }, + { + "desc": "Undo commit and unstage", + "cmd": "git reset HEAD~1" + }, + { + "desc": "Revert a pushed commit safely", + "cmd": "git revert " + } + ], + "related": [ + "git-discard", + "git-commit" + ], + "flags_explained": { + "--soft": "Keep changes staged", + "--mixed": "Keep changes but unstage (default)", + "HEAD~1": "One commit before HEAD" + } + }, + { + "id": "add-user", + "keywords": [ + "add", + "create", + "user", + "account", + "useradd" + ], + "category": "users", + "command": "sudo adduser ", + "description": "Create a new user account", + "examples": [ + { + "desc": "Create a user (interactive)", + "cmd": "sudo adduser alice" + }, + { + "desc": "Low-level create with home", + "cmd": "sudo useradd -m bob" + }, + { + "desc": "Create a system user", + "cmd": "sudo useradd -r svcuser" + } + ], + "related": [ + "delete-user", + "change-password", + "add-to-group" + ], + "flags_explained": { + "-m": "Create the home directory", + "-r": "Create a system account", + "-s": "Set the login shell" + } + }, + { + "id": "delete-user", + "keywords": [ + "delete", + "remove", + "user", + "account", + "userdel" + ], + "category": "users", + "command": "sudo deluser ", + "description": "Delete a user account", + "examples": [ + { + "desc": "Delete a user", + "cmd": "sudo deluser alice" + }, + { + "desc": "Delete user and home dir", + "cmd": "sudo deluser --remove-home alice" + }, + { + "desc": "Low-level delete", + "cmd": "sudo userdel -r bob" + } + ], + "related": [ + "add-user" + ], + "flags_explained": { + "--remove-home": "Also delete the user's home directory", + "-r": "(userdel) remove home and mail spool" + } + }, + { + "id": "change-password", + "keywords": [ + "password", + "passwd", + "change", + "reset", + "credentials" + ], + "category": "users", + "command": "passwd", + "description": "Change a user's password", + "examples": [ + { + "desc": "Change your own password", + "cmd": "passwd" + }, + { + "desc": "Change another user's (root)", + "cmd": "sudo passwd alice" + }, + { + "desc": "Expire a password now", + "cmd": "sudo passwd -e alice" + } + ], + "related": [ + "add-user" + ], + "flags_explained": { + "-e": "Force password change on next login", + "-l": "Lock the account", + "-u": "Unlock the account" + } + }, + { + "id": "add-to-group", + "keywords": [ + "group", + "add", + "member", + "groups", + "usermod" + ], + "category": "users", + "command": "sudo usermod -aG ", + "description": "Add a user to a supplementary group", + "examples": [ + { + "desc": "Add user to sudo group", + "cmd": "sudo usermod -aG sudo alice" + }, + { + "desc": "Add to docker group", + "cmd": "sudo usermod -aG docker $USER" + }, + { + "desc": "Show a user's groups", + "cmd": "groups alice" + } + ], + "related": [ + "add-user", + "run-as-sudo" + ], + "flags_explained": { + "-a": "Append (don't replace existing groups)", + "-G": "Supplementary group list" + } + }, + { + "id": "apt-install", + "keywords": [ + "install", + "apt", + "package", + "add", + "software" + ], + "category": "packages", + "command": "sudo apt install ", + "description": "Install a package with APT (Debian/Ubuntu)", + "examples": [ + { + "desc": "Install a package", + "cmd": "sudo apt install htop" + }, + { + "desc": "Install without prompts", + "cmd": "sudo apt install -y nginx" + }, + { + "desc": "Install a specific version", + "cmd": "sudo apt install nginx=1.18.0-0ubuntu1" + } + ], + "related": [ + "apt-update", + "apt-remove", + "apt-search" + ], + "flags_explained": { + "-y": "Assume yes to prompts", + "--no-install-recommends": "Skip recommended packages" + } + }, + { + "id": "apt-update", + "keywords": [ + "update", + "upgrade", + "apt", + "refresh", + "patch" + ], + "category": "packages", + "command": "sudo apt update && sudo apt upgrade", + "description": "Refresh package lists and upgrade installed packages", + "examples": [ + { + "desc": "Refresh package index", + "cmd": "sudo apt update" + }, + { + "desc": "Upgrade everything", + "cmd": "sudo apt upgrade -y" + }, + { + "desc": "Full dist upgrade", + "cmd": "sudo apt full-upgrade" + } + ], + "related": [ + "apt-install", + "list-installed" + ], + "flags_explained": { + "update": "Refresh the package index", + "upgrade": "Install newer versions of installed packages", + "-y": "Assume yes" + } + }, + { + "id": "apt-search", + "keywords": [ + "search", + "find", + "apt", + "package", + "lookup" + ], + "category": "packages", + "command": "apt search ", + "description": "Search for available packages", + "examples": [ + { + "desc": "Search by keyword", + "cmd": "apt search image editor" + }, + { + "desc": "Show package details", + "cmd": "apt show gimp" + }, + { + "desc": "Find which package owns a file", + "cmd": "dpkg -S /usr/bin/python3" + } + ], + "related": [ + "apt-install", + "list-installed" + ], + "flags_explained": { + "search": "Full-text search of package names/descriptions", + "show": "Detailed package info" + } + }, + { + "id": "apt-remove", + "keywords": [ + "remove", + "uninstall", + "apt", + "delete", + "purge" + ], + "category": "packages", + "command": "sudo apt remove ", + "description": "Remove an installed package", + "examples": [ + { + "desc": "Remove a package", + "cmd": "sudo apt remove htop" + }, + { + "desc": "Remove with config files", + "cmd": "sudo apt purge nginx" + }, + { + "desc": "Remove unused dependencies", + "cmd": "sudo apt autoremove" + } + ], + "related": [ + "apt-install" + ], + "flags_explained": { + "remove": "Uninstall but keep config", + "purge": "Remove including config files", + "autoremove": "Drop orphaned dependencies" + } + }, + { + "id": "list-installed", + "keywords": [ + "list", + "installed", + "packages", + "dpkg", + "query" + ], + "category": "packages", + "command": "apt list --installed", + "description": "List installed packages", + "examples": [ + { + "desc": "List all installed", + "cmd": "apt list --installed" + }, + { + "desc": "Count installed packages", + "cmd": "dpkg -l | grep -c '^ii'" + }, + { + "desc": "Search installed", + "cmd": "apt list --installed | grep nginx" + } + ], + "related": [ + "apt-install", + "apt-search" + ], + "flags_explained": { + "--installed": "Only show installed packages", + "-l": "(dpkg) list packages" + } + }, + { + "id": "docker-ps", + "keywords": [ + "docker", + "containers", + "ps", + "running", + "list" + ], + "category": "docker", + "command": "docker ps", + "description": "List running containers", + "examples": [ + { + "desc": "Running containers", + "cmd": "docker ps" + }, + { + "desc": "All containers incl. stopped", + "cmd": "docker ps -a" + }, + { + "desc": "Only container IDs", + "cmd": "docker ps -q" + } + ], + "related": [ + "docker-logs", + "docker-stop", + "docker-exec" + ], + "flags_explained": { + "-a": "Show all (incl. stopped)", + "-q": "Quiet — only IDs", + "--format": "Custom Go-template output" + } + }, + { + "id": "docker-images", + "keywords": [ + "docker", + "images", + "list", + "local", + "repository" + ], + "category": "docker", + "command": "docker images", + "description": "List locally stored images", + "examples": [ + { + "desc": "List images", + "cmd": "docker images" + }, + { + "desc": "Remove an image", + "cmd": "docker rmi " + }, + { + "desc": "Prune dangling images", + "cmd": "docker image prune" + } + ], + "related": [ + "docker-run", + "docker-ps" + ], + "flags_explained": { + "-a": "Include intermediate images", + "-q": "Only image IDs", + "prune": "Remove unused images" + } + }, + { + "id": "docker-run", + "keywords": [ + "docker", + "run", + "start", + "container", + "launch" + ], + "category": "docker", + "command": "docker run ", + "description": "Create and start a container from an image", + "examples": [ + { + "desc": "Run interactively", + "cmd": "docker run -it ubuntu bash" + }, + { + "desc": "Run detached with port map", + "cmd": "docker run -d -p 8080:80 nginx" + }, + { + "desc": "Run and auto-remove", + "cmd": "docker run --rm alpine echo hi" + } + ], + "related": [ + "docker-ps", + "docker-stop", + "docker-exec" + ], + "flags_explained": { + "-d": "Detached (background)", + "-it": "Interactive + TTY", + "-p": "Publish host:container port", + "--rm": "Remove on exit", + "-v": "Mount a volume" + } + }, + { + "id": "docker-logs", + "keywords": [ + "docker", + "logs", + "output", + "container", + "debug" + ], + "category": "docker", + "command": "docker logs ", + "description": "Fetch the logs of a container", + "examples": [ + { + "desc": "Show logs", + "cmd": "docker logs web" + }, + { + "desc": "Follow live logs", + "cmd": "docker logs -f web" + }, + { + "desc": "Last 100 lines", + "cmd": "docker logs --tail 100 web" + } + ], + "related": [ + "docker-ps", + "docker-exec" + ], + "flags_explained": { + "-f": "Follow log output live", + "--tail": "Show only the last N lines", + "-t": "Show timestamps" + } + }, + { + "id": "docker-exec", + "keywords": [ + "docker", + "exec", + "shell", + "enter", + "container" + ], + "category": "docker", + "command": "docker exec -it bash", + "description": "Run a command inside a running container", + "examples": [ + { + "desc": "Open a shell", + "cmd": "docker exec -it web bash" + }, + { + "desc": "Run a one-off command", + "cmd": "docker exec web ls /app" + }, + { + "desc": "As a specific user", + "cmd": "docker exec -u root -it web sh" + } + ], + "related": [ + "docker-ps", + "docker-logs" + ], + "flags_explained": { + "-it": "Interactive + TTY", + "-u": "Run as a specific user", + "-e": "Set an environment variable" + } + }, + { + "id": "docker-stop", + "keywords": [ + "docker", + "stop", + "kill", + "container", + "remove" + ], + "category": "docker", + "command": "docker stop ", + "description": "Stop a running container", + "examples": [ + { + "desc": "Stop a container", + "cmd": "docker stop web" + }, + { + "desc": "Stop all running", + "cmd": "docker stop $(docker ps -q)" + }, + { + "desc": "Force kill", + "cmd": "docker kill web" + } + ], + "related": [ + "docker-ps", + "docker-run" + ], + "flags_explained": { + "stop": "Graceful stop (SIGTERM then SIGKILL)", + "kill": "Immediate SIGKILL", + "-t": "Seconds to wait before killing" + } } ], "categories": { "files": { "name": "File Operations", - "tasks": ["list-files-by-size", "find-large-files", "compress-folder", "disk-usage", "find-files-by-name", "file-permissions", "find-duplicates", "create-symlink", "extract-archive"] + "tasks": [ + "list-files-by-size", + "find-large-files", + "compress-folder", + "disk-usage", + "find-files-by-name", + "file-permissions", + "find-duplicates", + "create-symlink", + "extract-archive", + "copy-files", + "move-rename", + "delete-files", + "create-directory", + "change-ownership", + "sync-directories", + "find-recent-files", + "find-empty-dirs" + ] }, "text": { "name": "Text Processing", - "tasks": ["search-in-files", "find-and-replace", "count-lines", "compare-files"] - }, - "network": { - "name": "Network Operations", - "tasks": ["download-file", "check-ports", "check-connectivity"] + "tasks": [ + "search-in-files", + "find-and-replace", + "count-lines", + "compare-files", + "sort-lines", + "unique-lines", + "extract-columns", + "view-file", + "json-query", + "word-frequency" + ] }, "system": { "name": "System Monitoring", - "tasks": ["monitor-cpu", "monitor-memory", "process-kill", "list-processes", "watch-command"] + "tasks": [ + "monitor-cpu", + "monitor-memory", + "process-kill", + "list-processes", + "watch-command", + "disk-free", + "system-uptime", + "service-status", + "view-logs", + "find-process-by-port", + "schedule-cron", + "cpu-info", + "kernel-messages" + ] + }, + "network": { + "name": "Network Operations", + "tasks": [ + "download-file", + "check-ports", + "check-connectivity", + "dns-lookup", + "copy-to-remote", + "check-website", + "public-ip" + ] + }, + "git": { + "name": "Git Version Control", + "tasks": [ + "git-status", + "git-log", + "git-discard", + "git-commit", + "git-branch", + "git-checkout", + "git-merge", + "git-stash", + "git-diff", + "git-clone", + "git-pull", + "git-push", + "git-undo-commit" + ] + }, + "users": { + "name": "User Management", + "tasks": [ + "current-user", + "who-logged-in", + "add-user", + "delete-user", + "change-password", + "add-to-group" + ] + }, + "packages": { + "name": "Package Management", + "tasks": [ + "apt-install", + "apt-update", + "apt-search", + "apt-remove", + "list-installed" + ] + }, + "docker": { + "name": "Docker", + "tasks": [ + "docker-ps", + "docker-images", + "docker-run", + "docker-logs", + "docker-exec", + "docker-stop" + ] } } }