LCKDO(1)
β¨ LCKDO β¨
okay bestie, gather round, because lckdo is one of those lil moreutils gems that's giving quietly iconic π
πΈ NAME πΈ
lckdo β run a program with a lock held π
π¦ SYNOPSIS π¦
lckdo [options] {lockfile} {program} [arguments]
π DESCRIPTION π
So basically lckdo runs a program with a lock held, and the whole point is to stop multiple processes from running in parallel β like, no cap, it's a bouncer at the club door of your process table π. Use it just like nice or nohup, fr fr.
okay so here's the sad part π β now that util-linux contains a similar command namedflock,lckdois deprecated, and it will be removed from some future version of moreutils. it's giving retirement era, and we're not okay about it π
π OPTIONS π
-wβ if the lock is already held by another process, just wait for it to complete instead of failing immediately. patience is a virtue bestie π«Ά-W {sec}β the same as-w, but wait not more thansecseconds. so like, waiting with a timer β°-eβ execute the program directly without forking and waiting (keeps an extra file descriptor open). lowkey efficient β¨-E {nnn}β set the file descriptor number to keep open whenexec()ing (implies-e). you pick the number, she keeps the door open πͺ-nβ do not create the lock file if it does not exist. no lock file? no problem, she's not making one π-qβ produce no output if the lock is already held. silent treatment, but make it intentional π-sβ lock in shared (read) mode. we're all reading together, cozy πΈ-xβ lock in exclusive (write) mode (default). one at a time, main character energy π-tβ test for lock existence. just checking, no commitment π§
π EXIT STATUS π
If the lock was successfully acquired, the return value is that of the program invoked by lckdo β so whatever your program says goes, she's just the messenger π.
If the lock couldn't be acquired, EX_TEMPFAIL is returned. π
If there was a problem opening/creating or locking the lock file, EX_CANTCREAT or EX_OSERR will be returned. π
β AUTHOR β
Michael Tokarev β we love a legend π«Ά
and that's the whole page bestie!! this one's from moreutils, dated 2007-08-15 β yes she's an elder icon and yes she still slays πβ¨ bye ily π¦
π¦ where this page comes from
- debian bookworm: moreutils 0.67-1 Β· GPL-2.0-or-later
- debian trixie: moreutils 0.69-1 Β· GPL-2.0-or-later
- epel 10: moreutils 0.68-3.el10_0 Β· GPL-2.0-only
- epel 9: moreutils 0.68-1.el9 Β· GPLv2
- fedora 43: moreutils 0.68-5.fc43 Β· GPL-2.0-only
- fedora 44: moreutils 0.68-6.fc44 Β· GPL-2.0-only
- nixos 26.05: moreutils 0.70
- nixpkgs unstable: moreutils 0.70
- opensuse-leap 16.0: moreutils 0.68-bp160.1.13 Β· GPL-2.0-only AND GPL-2.0-or-later AND (GPL-2.0-or-later OR MIT) AND BSD-2-Clause AND SUSE-Public-Domain
- opensuse-leap 16.0: moreutils 0.68-bp160.1.13 Β· GPL-2.0-only AND GPL-2.0-or-later AND (GPL-2.0-or-later OR MIT) AND BSD-2-Clause AND SUSE-Public-Domain
- opensuse-leap 16.0: moreutils 0.68-bp160.1.13 Β· GPL-2.0-only AND GPL-2.0-or-later AND (GPL-2.0-or-later OR MIT) AND BSD-2-Clause AND SUSE-Public-Domain
- opensuse-leap 16.0: moreutils 0.68-bp160.1.13 Β· GPL-2.0-only AND GPL-2.0-or-later AND (GPL-2.0-or-later OR MIT) AND BSD-2-Clause AND SUSE-Public-Domain
- ubuntu jammy: moreutils 0.66-1 Β· GPL-2.0-or-later
- ubuntu noble: moreutils 0.69-1 Β· GPL-2.0-or-later
- ubuntu questing: moreutils 0.69-1
- ubuntu resolute: moreutils 0.69-1build1 Β· GPL-2.0-or-later
- ubuntu stonking: moreutils 0.70-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms