Skip to main content

dieyoung

Find / kill very long running processes by name, args and age

Installation

recommended way: pipx install dieyoung

or (better if inside python virtualenv): pip install dieyoung your system may have pip3 instead of pip.

Find processes by name / arguments, three different modes

See all my ssh sessions:

$ dieyoung ssh
732333 8h ssh alv
742297 7h ssh jul
745335 6h ssh mx
875490 38m ssh -i /home/xenon/.ssh/id_ed25519 mx
880910 25m ssh mx -i /home/xenon/.ssh/id_ed25519

Format is simple: pid, age, cmdline

Now, lets suppose we want to find only ssh to mx:

$ dieyoung ssh mx
745335 6h ssh mx
875490 39m ssh -i /home/xenon/.ssh/id_ed25519 mx
880910 25m ssh mx -i /home/xenon/.ssh/id_ed25519

Three sessions are found, because each of them has "ssh" and "mx" in cmdline (in any order). This is how --mode any works (default mode), processes matches our pattern if all words from pattern are found anywhere in process cmdline, even if there are other arguments.

--mode start: First words of cmdline must match pattern, e.g.

$ dieyoung -m start -- ssh -i 
875490 39m ssh -i /home/xenon/.ssh/id_ed25519 mx

But this filter will not find process ssh mx -i /home/xenon/.ssh/id_ed25519 (because ssh mx is not ssh -i). Note, we used -- to separate PATTERN (ssh -i) from dieyoung arguments.

--mode full: process cmdline must fully match pattern, e.g.

$ dieyoung -m full -- ssh -i /home/xenon/.ssh/id_ed25519 mx
875490 40m ssh -i /home/xenon/.ssh/id_ed25519 mx

Filter by age, user and executable

To find processes older then some age use -a / --age option, like -a 1h30m (to find processes older then 1 hour and 30minutes)

--exe PATH to find only processes with this executable, e.g. if you want to find /usr/bin/php but not /opt/php/7.4/bin/php.

--user USERNAME to find only processes of this user.

Kill / Terminate processes

After you found processes, you may kill it manually with kill command, or use built-in feature. Add --terminate option to gracefully send SIGTERM to each matching process or --kill to send SIGKILL (like kill -9 <pid>).

Inspect more details of processes

Add -j / --json to show more info about processes

Foolproof protection (--notmore)

If --kill or --terminate given, dieyoung will count number of matching processes and refuse if it has to kill more then --notmore N. Default value is 1.

Metadata

Release files for dieyoung 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dieyoung 0.0.7
File Size Uploaded Provenance
dieyoung-0.0.7.tar.gz 6.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for dieyoung 0.0.7
File Interpreter ABI Platform
dieyoung-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 11.7 kB

Release files / dieyoung-0.0.7.tar.gz

Download URL dieyoung-0.0.7.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b7e2571cfc92e765d6ecaf142c0420bb9c510768c7d5369ea53c51abc7af214e
BLAKE2b-256 checksum
How to use checksums
bbc8c7044a122f7f60ffed1a4f571b92da7acc85456e5e1e37c36b4fd5b68b07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.27.0

Release files / dieyoung-0.0.7-py3-none-any.whl

Download URL dieyoung-0.0.7-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82afae536e4ff881d4541cd91ec0524f23ca6f354ea28b8a714e7a01500c4835
BLAKE2b-256 checksum
How to use checksums
0b91160142920916b263190a977745ca0042590a8ae5344bbf5f003833eaabb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.27.0

Security for dieyoung 0.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page