5 ms·
Genuine question: I thought that operating systems only have one shell, but that can be accessed by multiple terminals? So this should be alternative terminals?
by bennysonething 6y ago
Genuine question: I thought that operating systems only have one shell, but that can be accessed by multiple terminals? So this should be alternative terminals?
I'm not trying to be a pedant I just thought I understood something, now Im not so sure.
- drewg123 6y agoA unix/linux OS can have multiple shells. The shell you land in at login is determined by the shell listed in your account's /etc/passwd entry and can often be changed via chsh command.
- snarfy 6y agoA terminal is a device. It can be physical like the console or a vt100 or similar, or virtual. It represents an input an display. A shell is a program that opens this device and performs IO with it.
- rmorey 6y agoin my understanding: “shell” is kind of a loosely defined term in this context, but i just think of it as a textual interface to the whole system. really it’s just a program that accepts text commands (or scripts) and performs actions on the system or launches other programs, and manipulates and displays the results. eg: sh bash zsh fish xonsh “terminal” is pretty well defined as a graphical UI program which presents you with the shell of your choosing (historically related to teletype or whatever) eg: xterm Terminal.app Konsole iTerm alacritty for the most part you can use any terminal with any shell, so the terms kind of coalesce into the more generic idea of a “command line” also all of this is for unix-like systems, eg linux macos bsd. windows is... well windows hope this makes sense!
- indymike 6y agoGood question. Depends on the OS. In the case of Linux (and other Unixish OSes), getty is the program that makes a terminal or console session work on the host side. Getty usually launches a program, login, that takes your username and password, retrieves your account's settings and launches your interactive shell (something like bash, zsh, fish or oil) when you successfully authenticate. Incidentally, tools like screen and byobu allow multiple terminals to attach to the same shell by multiplexing the terminal (not the shell).
- injinj 6y agoI was thinking of extending my shell (desh) so that stores the environment and history on a server so that a shell started on any host in a network could optionally stay in sync with the other instances. Eg. ENV={ssh host envstore} ; HIST={ssh host histstore}