LOCK(1)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.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:

  1. it hits the timeout interval and dips 😭
  2. 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. πŸ’…
  • -t timeout β€” 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 -S option of vidcontrol(1), so it has the same restrictions (iykyk). it's only available if the terminal in question is a syscons(4) or vt(4) virtual terminal. πŸ–₯️
ngl, that last one is a whole vibe check on your terminal type β€” if you're not on a syscons(4) or vt(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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms