Terminal and write command

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
daub
Level 1
Level 1
Posts: 3
Joined: Fri May 07, 2021 3:51 am

Terminal and write command

Post by daub »

Hello!
My first post here. I am quite inexperienced linux user. I have been playing around with an old netbook, trying to understand linux a bit. Testing this and that. The device does not get much use anymore, so if anything I do ends up killing it, it will not be a major loss :) . So the other day I found out about the write command and decided to try it out. The netbook has a very small screen, so instead I used putty to ssh in to the device, as the second user.
When I opened terminal in the device it did not show anything I wrote from putty, but in putty I did see what I wrote on the device. I did remember to initiate the write command on both sides. I did check the mesg option, which was y, so I should get the message, but I did not.
So this leads me to the question I guess might be the reason behind this. I understand that mint comes with a terminal emulator, but what is the difference between terminal and terminal emulator? I do not see any other terminal options in the menus.

I hope this question is silly enough for newbie section, if not, I am sure it will be moved to the appropriate one.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
manyroads
Level 5
Level 5
Posts: 586
Joined: Wed Mar 30, 2011 11:14 am
Location: just around the corner
Contact:

Re: Terminal and write command

Post by manyroads »

Why are you trying to ssh yourself on a single PC? If screen space is an issue, you probably should use multiple workspaces for your primary users. But if you really want to play with ssh... try these or something similar:
https://www.ssh.com/academy/ssh/command
https://phoenixnap.com/kb/linux-ssh-commands

FWIW in the 25 years I've used Linux I never have had to ssh myself. :shock:

Do yourself a huge favor and take some online (FREE) basic linux tutorials.
Pax vobiscum,
...mark
SwayWM, i3wm, bspwm, hlwm, dwm
Professional Genealogist & Technologist
(http://eirenicon.org & http://many-roads.com)
daub
Level 1
Level 1
Posts: 3
Joined: Fri May 07, 2021 3:51 am

Re: Terminal and write command

Post by daub »

Thanks for the reply, but the ssh was not the issue, that works just fine and I go to that computer over ssh more, than I use its own keyboard. My question was, why I could not see the messages sent with the write command, on the device terminal emulator. Is the terminal emulator something different, than terminal?
newlyminted7
Level 5
Level 5
Posts: 558
Joined: Sat Jan 02, 2021 4:44 pm

Re: Terminal and write command

Post by newlyminted7 »

Hmm, I think I understand your question, and I'm not sure if I have the correct answer, but I will offer it up for what it's worth. I believe the name "Terminal", as far as computers go, refers to a "Computer Terminal" (as a noun), at which a computer user sat to enter data. In the 60's, 70's, 80's, (90's?), these were computers that had a screen that only accepted keyboard input, and was only a command-line-only environment. There was generally no mouse or other graphical software available for its screen. It couldn't "change" to be a graphical screen of any other type; it was a "hardware" terminal, accepting only keyboard input.

Since then, on computer screens using graphical windowing environments like Windows, MacOS, Linux, etc, many different types of things can be displayed, therefore these computers aren't just traditional hardware "Terminals" anymore. On these types of displays, when we run a "Terminal" software application, it is, technically speaking, emulating what used to be a hardware "terminal only" environment. Graphical software that gives you a command-line environment, like in Linux, is therefore a "Terminal Emulator" because it is not a true, old-school, hardware command-line-only environment, but software.

Hopefully this makes sense and is correct. I might be totally wrong, so maybe others can offer their input if I'm way off...

By the way, what do you mean by "write" - are you trying to display something on the screen of the Linux machine via SSH from another computer over a network?
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: Terminal and write command

Post by rene »

No, newlyminted7 isn't way off, but as to write (it's a very old-school inter-terminal communication program) things have changed lately. Where it still works is on the Linux virtual consoles, i.e., the text-mode terminals reachable by Ctrl-Alt-F1 through -F6 from X. If you login as your user on e.g. the Ctrl-Alt-F1 and Ctrl-Alt-F2 consoles and say mesg y in both you can write between them with e.g write $(whoami) tty2 and same with tty1 (Ctrl-D to end input and actually send).

Although this also still works between actual xterms (sudo apt-get install xterm) which still have their own so-called "pseudo terminal" devices as displayed by e.g. who, it no longer does in for example gnome-terminal hence not in Cinnamon and as far as I can now quickly see in the Xfce terminal neither. Progress, let's say, and let me spare you any related rants.

In essence an ssh connection does allocate a pseudo terminal much like xterm so in essence things probably work but you probably run into that same issue of this not working in modern X terminal emulators any more regardless of ssh or not; of being able to write between the text-mode virtual consoles and the ssh terminal, just not between a modern virtual terminal and the ssh one.

Yes, confusing, and admittedly, write really is rather obsolete so let's not find e.g. gnome-terminal fully at fault...

[EDIT] By the way, yes, it's confirmed to also work between e.g. tty1 and pts/0 if you run ssh in an xterm with that pts. So just the "normal" gnome-terminal thing...
daub
Level 1
Level 1
Posts: 3
Joined: Fri May 07, 2021 3:51 am

Re: Terminal and write command

Post by daub »

Thanks to both of you! :)
I got smarter again.
Locked

Return to “Beginner Questions”