LOCK(1)
π lock(1) β bestie edition, from the General Commands Manual π
okay so. lock is the utility that just... reserves your terminal. like putting a little "do not disturb" sign on your keyboard but make it β¨secureβ¨. it asks you for a password, reads it again to make sure you actually typed what you meant (we love a double-check), and then, normally, it will not give the terminal back until you type that password once more. periodt.
there are two other ways out, though, and you should know them:
- it'll time out after a while π°οΈ
- someone with the right permissions can literally just kill it π
β¨ SYNOPSIS β¨
lock [-npv] [-t timeout]
πΈ DESCRIPTION πΈ
so here's the whole vibe. lock requests a password from you, reads it a second time for verification, and then just sits there holding your terminal hostage until you repeat the password. it is not letting go otherwise. the two exceptions, again, no cap:
- it hits the timeout interval and dips π
- someone with the appropriate permission kills it π
the following options are available, bestie, and you're gonna want to know all of them:
-nβ do not use a timeout value. terminal will be locked forever. like, forever forever. no take-backs. π«Ά-pβ a password is not requested; instead the user's current login password is used. iconic, low-effort, we love her. π-ttimeoutβ the time limit (default *15 minutes) is changed to *timeout minutes. your clock, your rules β°-vβ disable switching virtual terminals while this terminal is locked. it's implemented in a way similar to the-Soption ofvidcontrol(1), so it has the same restrictions (iykyk). it's only available if the terminal in question is asyscons(4)orvt(4)virtual terminal. π₯οΈ
ngl, that last one is a whole vibe check on your terminal type β if you're not on asyscons(4)orvt(4)virtual terminal, it's just not gonna happen for you.
π EXAMPLES π
lock the terminal for 5 minutes, disable switching virtual terminals, and require the user's login password to unlock. this is the main character example fr fr:
$ lock -p -t 5 -v
π¦ SEE ALSO π¦
vidcontrol(1), syscons(4), vt(4)
π HISTORY π
the lock command appeared in 3.0BSD.
and that's the whole page, bestie π β source and version tea: this one's the Debian build, dated December 11, 2020, and you're reading LOCK(1). now go lock that terminal ππ
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π the page's license: BSD-3-Clause
- Copyright (c) 1987, 1990, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms