Command-line tool
flock
brew/flock
Checked 25 Oct 2026, 21:09 UTC · Listing refreshed from Homebrew, winget, npm, Scoop and cargo; npm packages checked against OSV.dev
Lock file during command
At a glance
- Type
- Command-line tool
- Install on
- Windows, macOS, Linux
- Last checked
- 25 Oct 2026, 21:09 UTC
Install it
Windows
winget install --id FlockFZ.Flock -e
macOS
brew install flock
Linux
brew install flock
Run a command with a file lock as soon as the lock is available
flock path/to/lock.lock command
Run a command with a file lock, or exit if the lock is currently being held (with exit code 1)
flock -n path/to/lock.lock command
Run a command with a file lock, or exit with a specific error code if the lock is currently being held
flock -n -E 123 path/to/lock.lock command
Related command-line tools
- logrotate
Rotates, compresses, and mails system logs - rubund
Zero-copy Gemfile.lock parser library, with a placeholder CLI ahead of full bundle commands. - vmtouch
Portable file system cache diagnostics and control - rcs
GNU revision control system - pip-tools
Locking and sync for Pip requirements files - cargo-audit
Audit Cargo.lock files for crates with security vulnerabilities - deadlock
Unlock files or folders that cannot be deleted, copied, renamed or moved. - slackcat
Command-line utility for posting snippets to Slack
Listing text is written by the maker; AptLynx lists tools and does not vouch for them. Find another tool · Browse by topic · For agents