OPENVT(1)

๐Ÿ’– OPENVT(1) ๐Ÿ’–

okay bestie so this is openvt from the General Commands Manual and it's genuinely one of those little tools that just does things. sit with me.


โœจ NAME โœจ

openvt โ€” start a program on a new virtual terminal (VT). that's it, that's the whole job, and she does it flawlessly ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

openvt [-c vtnumber] [OPTIONS] [--] command

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so here's the vibe: openvt goes looking for the first available VT, and then runs the command you gave it on that VT โ€” with whatever command options you passed along too. standard input, standard output and standard error all get pointed at that terminal. everything flows there. it's giving full immersion ๐ŸŽ€

to find the command you asked for, it uses the current search path, aka $PATH. and if you don't specify a command at all? no worries, she just uses the environment variable $SHELL. iconic behavior honestly.


โœจ OPTIONS โœจ

  • -c, --console=VTNUMBER โ€” use this specific VT number instead of just grabbing the first available one. heads up though: you must have write access to the VT you're supplying or this is not gonna work, no cap.
  • -f, --force โ€” force open a VT without even checking whether it's already in use. living dangerously, love that for you ๐Ÿ”ฅ
  • -e, --exec โ€” directly execute the given command, without forking. this one is meant for use in /etc/inittab.
  • -s, --switch โ€” switch over to the new VT when the command starts. the VT of the new command becomes the new current VT. main character energy, she takes the screen ๐Ÿ‘‘
  • -u, --user โ€” figure out the owner of the current VT and run login as that user. suitable to be called by init. shouldn't be used with -c or -l. also: this option refuses to pre-authenticate root and requires a process owned by the VT owner whose controlling terminal is the current VT.
  • -l, --login โ€” make the command a login shell. a - gets prepended to the name of the command to be executed.
  • -v, --verbose โ€” be a bit more verbose. give us the tea โ˜•
  • -w, --wait โ€” wait for the command to complete. and if -w and -s are used together, openvt will switch back to the controlling terminal when the command completes. she comes back, she always comes back ๐Ÿซถ
  • -V, --version โ€” print program version and exit.
  • -h, --help โ€” show this text and exit.
  • -- โ€” end of options to openvt.

โš ๏ธ NOTE โš ๏ธ

if openvt is compiled with a getopt_long() and you wanna set options for the command that's gonna be run, then you must supply the end-of-options -- flag before the command. no skipping this step bestie, the parser will simply not understand you.

the -u option uses login -f and therefore bypasses normal password authentication for the detected user. it is intended only for controlled init or keyboard-request configurations. use a normal authenticated login command when authentication is required. fr fr, don't get cute with this one ๐Ÿ™ˆ


๐ŸŒˆ EXAMPLES ๐ŸŒˆ

openvt can be used to start a shell on the next free VT, by using the command:

openvt bash

to start the shell as a login shell, use:

openvt -l bash

to get a long listing you must supply the -- separator:

openvt -- ls -l

๐Ÿ’œ HISTORY ๐Ÿ’œ

earlier, openvt was called open. it was written by Jon Tombs</> <jon@gtex02.us.es> or <jon@robots.ox.ac.uk>. and the -w idea is from "sam". a whole little origin story, we love a throwback ๐Ÿงš


๐ŸŒŸ SEE ALSO ๐ŸŒŸ

chvt(1), deallocvt(1), vlock(1), login(1)


kbd ยท 24 October 2024 ยท that's the whole page bestie, go open a terminal and slay ๐Ÿ’–โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from