flock -n /tmp/x.lock cmd. Eleven characters plus a filename.