{"id":31628230,"url":"https://github.com/open-technology-foundation/psg","last_synced_at":"2026-05-08T14:02:59.580Z","repository":{"id":315340942,"uuid":"1059101303","full_name":"Open-Technology-Foundation/psg","owner":"Open-Technology-Foundation","description":"An enhanced process search utility that improves upon traditional ps | grep workflows with advanced filtering, sorting, and display options.","archived":false,"fork":false,"pushed_at":"2025-09-27T23:46:36.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-28T01:16:07.993Z","etag":null,"topics":["linux","ps","terminal"],"latest_commit_sha":null,"homepage":"https://yatti.id/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Open-Technology-Foundation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-18T02:08:37.000Z","updated_at":"2025-09-27T23:46:39.000Z","dependencies_parsed_at":"2025-09-18T04:16:52.801Z","dependency_job_id":"64f3ed1f-a70c-4773-a486-cdec3cadf3b4","html_url":"https://github.com/Open-Technology-Foundation/psg","commit_stats":null,"previous_names":["open-technology-foundation/psg"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Open-Technology-Foundation/psg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-Technology-Foundation%2Fpsg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-Technology-Foundation%2Fpsg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-Technology-Foundation%2Fpsg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-Technology-Foundation%2Fpsg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Open-Technology-Foundation","download_url":"https://codeload.github.com/Open-Technology-Foundation/psg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-Technology-Foundation%2Fpsg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278672315,"owners_count":26025884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linux","ps","terminal"],"created_at":"2025-10-06T20:20:47.786Z","updated_at":"2025-10-06T20:20:49.027Z","avatar_url":"https://github.com/Open-Technology-Foundation.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PSG - Process Search with Grep\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![GitHub](https://img.shields.io/github/stars/Open-Technology-Foundation/psg?style=social)](https://github.com/Open-Technology-Foundation/psg)\n\nAn enhanced process search utility that improves upon traditional `ps | grep` workflows with advanced filtering, sorting, and display options.\n\n## Features\n\n- **Smart Self-Filtering**: Automatically excludes the psg process itself from results using PID-based filtering\n- **Exact Process Matching**: Use `-e` flag to match exact process names (e.g., find only \"bash\" not \"/bin/bash\")\n- **Custom Field Display**: Select which process information fields to display\n- **Flexible Sorting**: Sort results by any field (CPU, memory, PID, etc.)\n- **Color Highlighting**: Automatic color highlighting of matched patterns\n- **Regular Expression Support**: Full regex pattern matching capability\n- **Case-Insensitive Search**: Optional case-insensitive searching\n- **Multiple Search Terms**: Search for multiple processes in one command\n- **Bash Completion**: Tab completion for options and process names\n\n## Installation\n\n### Quick Install\n\n#### From GitHub\n```bash\n# Clone the repository\ngit clone https://github.com/Open-Technology-Foundation/psg.git\ncd psg\n\n# Copy to system path\nsudo cp psg /usr/local/bin/psg\nsudo chmod +x /usr/local/bin/psg\n\n# Install bash completion (optional)\nsudo cp .bash_completion /etc/bash_completion.d/psg\n```\n\n#### Direct Download\n```bash\n# Download directly\nwget https://raw.githubusercontent.com/Open-Technology-Foundation/psg/main/psg\nsudo mv psg /usr/local/bin/psg\nsudo chmod +x /usr/local/bin/psg\n```\n\n### Manual Install\n```bash\n# Make executable\nchmod +x psg\n\n# Add to PATH or create alias\necho \"alias psg='$(pwd)/psg'\" \u003e\u003e ~/.bashrc\nsource ~/.bashrc\n```\n\n## Usage\n\n```bash\npsg [OPTIONS] keyword...\n```\n\n### Options\n\n| Option | Long Form | Description |\n|--------|-----------|-------------|\n| `-f` | `--fields` | Specify which fields to display (comma-separated) |\n| `-s` | `--sort` | Sort output by specified field |\n| `-e` | `--exact` | Match exact process name only |\n| `-r` | `--regex` | Treat keywords as regular expressions |\n| `-c` | `--case` | Case-sensitive search (default: insensitive) |\n| `-n` | `--no-color` | Disable colored output |\n| `-q` | `--quiet` | Don't print header line |\n| `-v` | `--verbose` | Print header line (default) |\n| `-h` | `--help` | Show help message |\n| `--` | | Pass remaining options to ps command |\n\n### Available Fields\n\n- **Process Info**: `pid`, `ppid`, `pgid`, `tty`\n- **User Info**: `user`, `ruser`, `group`, `rgroup`\n- **Performance**: `pcpu`, `pmem`, `nice`, `vsz`, `rss`\n- **Time**: `etime`, `time`\n- **Command**: `comm`, `args`\n- **State**: `stat`\n\n## Examples\n\n### Basic Search\n```bash\n# Find all bash processes\npsg bash\n\n# Find all python processes\npsg python\n\n# Search for multiple processes\npsg bash python node\n```\n\n### Exact Matching\n```bash\n# Find only processes named exactly \"bash\" (not /bin/bash)\npsg -e bash\n\n# Find exactly \"nginx\" master process\npsg -e nginx\n```\n\n### Custom Field Display\n```bash\n# Show only PID, user, CPU%, and command\npsg -f pid,user,pcpu,args firefox\n\n# Minimal display with PID and command name only\npsg -f pid,comm chrome\n\n# Detailed memory information\npsg -f pid,user,pmem,vsz,rss,args java\n```\n\n### Sorting Results\n```bash\n# Sort by CPU usage (highest first)\npsg -s pcpu\n\n# Sort by memory usage\npsg -s pmem chrome\n\n# Sort by elapsed time\npsg -s etime\n```\n\n### Advanced Filtering\n```bash\n# Case-sensitive search\npsg -c Docker\n\n# Regular expression search\npsg -r 'python[23]'\npsg -r '^/usr/bin/.*sh$'\n\n# Combine options\npsg -f pid,pcpu,args -s pcpu -r 'node|npm'\n```\n\n### Process Management\n```bash\n# Find and kill a process\npsg firefox  # Find PID\nkill $(psg -q -f pid firefox)\n\n# Monitor specific processes\nwatch -n 2 \"psg -f pid,pcpu,pmem,args -s pcpu java\"\n\n# Count processes by name\npsg -q postgres | wc -l\n```\n\n### System Administration\n```bash\n# Find all processes by a user\npsg -f pid,user,pcpu,pmem,args . | grep username\n\n# Find high CPU consumers\npsg -s pcpu -f pid,user,pcpu,args | head -20\n\n# Find processes on specific terminal\npsg -f pid,tty,user,args . | grep pts/1\n\n# Pass options to ps\npsg -- -u root nginx\n```\n\n## Advanced Features\n\n### PID-Based Filtering\nPSG uses intelligent PID-based filtering to exclude itself from search results. This works reliably even when:\n- Called via different paths (`./psg`, `/usr/local/bin/psg`)\n- Invoked through shell scripts\n- Running multiple instances simultaneously\n\n### Exact Match Mode\nThe exact match mode (`-e`) uses the `comm` field from ps, which contains only the program name without path or arguments. This is perfect for finding specific daemons or services.\n\n### Field Management\nPSG dynamically manages ps output fields:\n- Automatically adds required fields for internal processing\n- Removes internal fields from final output\n- Preserves original field order and formatting\n\n## Troubleshooting\n\n### No Results Found\n- Check if the process name is spelled correctly\n- Try without exact match flag (`-e`)\n- Use case-insensitive search (default)\n\n### Permission Denied\n- Some process information requires root access\n- Use `sudo psg` for system processes\n\n### Performance Issues\n- For large result sets, limit fields with `-f`\n- Use specific search terms instead of broad patterns\n- Pipe to `head` or `tail` for limiting output\n\n### Completion Not Working\n```bash\n# Source the completion file\nsource /etc/bash_completion.d/psg\n# Or\nsource ~/.bash_completion\n```\n\n## Comparison with Traditional Methods\n\n| Task | Traditional | PSG |\n|------|-------------|-----|\n| Find firefox | `ps aux \\| grep firefox \\| grep -v grep` | `psg firefox` |\n| Find by exact name | `ps aux \\| grep '^nginx '` | `psg -e nginx` |\n| Sort by CPU | `ps aux \\| grep app \\| sort -nrk 3` | `psg -s pcpu app` |\n| Custom fields | `ps -eo pid,pcpu,args \\| grep java` | `psg -f pid,pcpu,args java` |\n\n## Technical Details\n\n- **Language**: Pure Bash (5.2.21+)\n- **Dependencies**: Standard Unix utilities (ps, grep, awk, sort, sed)\n- **Compatibility**: Linux, macOS, Unix-like systems\n- **Performance**: Optimized with single-pass filtering\n\n## Contributing\n\nPSG is actively maintained. For bugs, feature requests, or contributions:\n\n- **Repository**: [https://github.com/Open-Technology-Foundation/psg](https://github.com/Open-Technology-Foundation/psg)\n- **Issues**: [https://github.com/Open-Technology-Foundation/psg/issues](https://github.com/Open-Technology-Foundation/psg/issues)\n- **Pull Requests**: [https://github.com/Open-Technology-Foundation/psg/pulls](https://github.com/Open-Technology-Foundation/psg/pulls)\n\n### Development Guidelines\n- Check existing issues before submitting new ones\n- Test changes with various process types and edge cases\n- Follow the Bash coding standards in BASH-CODING-STANDARD.md\n- Ensure compatibility with bash 5.2.21+\n- Include examples in commit messages for new features\n\n## License\n\nPSG is open source software. See LICENSE file for details.\n\n## Version History\n\n- **2.0.0**: PID-based filtering, exact match mode, improved field handling\n- **1.0.0**: Initial release with basic search, sort, and field selection\n\n---\n\n*PSG - Making process search powerful yet simple*","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-technology-foundation%2Fpsg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-technology-foundation%2Fpsg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-technology-foundation%2Fpsg/lists"}