47
hashit
6y

OS Lab Day 1 :

Teacher - Log in to Ubuntu , open "linux cmd."

Comments
  • 3
  • 2
    To be fair, it can make more sense for a Linux newbie who's coming from Windows. Although it must be duly noted by the faculty that it is terminal and not cmd 😄
  • 1
    @Electrux I know it's a terminal but I keep referring to it as CLI... is that incorrect?
  • 0
    @LordPeeve nah that's just fine to me. I am used to all those terms so it don't matter that much to me but it is just a personal preference and I think one should use whatever they feel comfortable with, as long as it is not misleading or downright wrong. 😉
  • 1
    @Electrux got it, cheers :)
  • 1
    tty 🙃
  • 2
    technically the 'linux cmd' term fits the bill. Windows' CMD (cmd.exe) means "COMMAND" (there was also COMMAND.EXE). You open up an environment where you work with commands so in a way Linux CMD is quite correct.

    On the other hand calling terminal emulator a TERMINAL on Linux is in my opinion less correct. Terminals are (or at least used to be) PHYSICAL UNITS - TeleTYpewriters, hence the TTY name. They used to have both input and output capabilities. Connected via (correct me if I'm wrong) serial ports. OS has several actual TTY ports enabled and configured by default. Ctrl+alt+f1-f6 says TTY because it sort of connects you to those ports - emulates physical device. F7 (often) is another TTY running an app capable to draw graphics - this is where your UNITY or CINNAMON runs. And ALL gnome-terminal, xterm or other applications are running in that very same TTY7.
  • 0
    xterm, gnome-terminal, etc. applications open up a pseudodevice called PTS -- a pseudoterminal. Nowdays OS has up to 7 or 8 TTYs enabled which is to little. PTS emulates a TTY. There are several emulation modes: VT100, VT50, xterm, etc.. Most likely you are using xterm mode (see your env vars: echo ${TERM}).

    Linux/UNIX OS consists of 3 main layers: the kernel (the OS itself), the shell (consumes the OS api, lets run commands via CLI, do some scripting, etc.) and other applications and utilities. Now the gnome-terminal application itself falls to the latter group, but it gives you access to the middle-layer - the shell. so you fire up gnome-terminal via terminal 7 (TTY7), it reserves a new PTS device, starts emulating a TTY. Then gnome-terminal executes a shell executable (like /bin/bash) in that PTS which you are using. So TECHNICALLY it's more correct to say "I use shell" rather than "I use terminal". Because you always use a terminal (TTY7), even to open a firefox window.
  • 0
    Let me correct myself. /bin/bash is NOT executed in the PTS per-se. It is executed in userspace just like any other process. gnome-terminal just links named file descriptors of that process to the PTS: fd0, fd1 and fd2, which effectively gives you ability to interact with the process yourself via TTY7 (Xorg maps TTY7 I/O with your graphical environment (and monitor), keyboard and mouse)
  • 0
    omg how he dares not call it bash but just use a generic word like CMD (or CLI or terminal...) /s
    like apple fans complains when someone call iphone or macbook, smartphone or pc
Add Comment