 Today, I want to share with you a couple of useful command line utilities, especially for those of you that work with servers, those of you that hang out in the TTY, because if you work with servers, maybe an IT or system administration, things like that, you hang out a lot on the TTY, right, and maybe you work on a server that has multiple users that log in to the same server. Did you know that you can actually send messages to other users on the system? If they're logged in, if you know their username and you know the TTY that they're logged into, you can actually send them messages. That's what we're going to talk about today. So for this example, I'm using a virtual machine of Ubuntu. This is the standard desktop edition of Ubuntu, but we're going to just imagine that I installed a Ubuntu server for this. Matter of fact, I'm just going to go ahead and switch to a TTY. And I'm going to switch to TTY3. Let me log in. So I've got one user on the system, one regular user named DT. I'm logged in. This font size is really small. I really should increase this font size. I'm going to go up here, Invert Manager, and I'm going to scale the display a little bit. That increases it just a little bit, but not enough. What I'm going to do on Ubuntu, I could do an LS on slash user slash share slash, I believe it's console fonts. Yeah. And that will give me a list of all of the available console fonts, you know, the fonts that you could use inside the TTY. Now this is specifically for Ubuntu on other systems. You would find all of the console fonts in different places. I know on Fedora, you'll find the console fonts typically in, I believe it's slash lib slash KBD slash console fonts on Arch. I know it's slash user slash share slash KBD slash console fonts. But what you could do is you could just do a find. You could do sudo find the standard GNU find command slash. So we're going to search enroute dash I name, so an insensitive case name search, and then search for console fonts, because that should be the directory on every Linux system. Do a search for that. Give it your sudo password. And you can see it found user share console fonts here on Ubuntu, again on other distributions. It'll be a different directory. Just run an LS on that directory to get a list of appropriate console fonts. What I'm going to do is I see one here in this middle column that looks like it'll be a bigger size font. It's Latin 15 dash terminus 32 by 16. So 32 by 16 is a bigger font size. So I'm going to use the set font command, all one word set font space, and then just give it the name of the font. So lat 15 dash terminus 32 by 16 dot psf dot gz. And if I type that right. Yeah. Well, we can actually see TTY3 here. Now this is just temporary, right? If you actually wanted to make this change permanent, what you would want to do, let me move my head out of the way, is you would actually want to do a sudo vm or whatever text editor you want to use. And on Ubuntu it'd be slash etsy slash default slash console dash setup. And again, that file will be a different place on different distributions. That's just for Ubuntu. For example, on Fedora, I think the file would be slash etsy slash vconsole dot com would be the name. But anyway, what you want to do is if there's a line that already has font equals, you would change it. If there's not one, you would write font all caps equals and no space here. And then you're opening and closing quotation marks there and then just put the font. So lat 15 dash terminus, let me make sure I spell it correctly. So this is actually kind of dangerous. I should have backed up this file just in case I make a mistake, but I'm pretty sure I did that correctly. So let me write and quit that. What I'm actually going to do is I'm just going to reboot the machine just to see if now all of my TTYs have a more appropriate font. So the machine rebooted just fine. So I'm going to switch to this virtual terminal, right, TTY 3. And you can see I'm not logged in, but it did remember now it's permanently saved that I always want my TTY console font to be that terminus 32 by 16 font. So now let me log in to TTY 3 and then I'm going to switch to TTY 4. I'm also going to log in as the DT user on TTY 4. The first thing I want to show you is the right command and the right command is dead simple to use. There's not much to it. If you do a man on right, you can read the man page, but you can see right user TTY name. Really all there is to it. So let me cue to quit out of the man page. Let me clear so I can get the prompt back up toward the top of the screen there. So you can see right, I'm going to write to the DT user. The DT user is the only user on the system and I need to find the TTY that DT is currently logged into. Well, that's assuming I know I logged in myself. I know exactly my username and my TTY. But if you were on a server, you have no idea who is logged in and where they're logged in. Who and who tells me that there are two users logged in? Well, it's really the same user. DT is logged into TTY 3, DT is also logged into TTY 4. Right now I'm on TTY 4, but I'm going to write to DT on TTY 3. I'm going to hit enter and it says you have right permission turned off. So the DT user is not allowing right permissions, right? So there's a couple of things I could do here. I could actually just up arrow and I could run this command with sudo privileges because then I would have permission to do anything I want, right? So sudo write DT on TTY 3. And you can see that I get a cursor that's just blinking. It's waiting for something, right? It's waiting for the message. What do you want to write? I'm going to say hello DT exclamation hit enter. And then what I'm going to do is I'm going to do control D. Control D is a shell end of file signal. It basically tells the shell I was writing essentially to a file, well I was writing this message here and now I'm done. So control D and you can see I get the prompt back here. Now let me switch to TTY 3. And you can see that I actually got the message on TTY 3, hello DT and EOF end of file. And you see the cursor is blinking here. So it gave me the message here on TTY 3. Let me do a control C just to get my prompt back and clear the screen. Now typically you're not going to have sudo privileges a lot of times when you're messaging people on these servers. So the real way to do this is just to go ahead and allow your user to actually receive messages. So message MESG space Y for yes. And now I've allowed DT on TTY 3 to receive messages. So if I go back to TTY 4, now I can just do write DT and TTY 3 and now it shouldn't give me an error. That still gives me an error. Maybe I need to run message Y here and then up arrow write DT, TTY 3, yeah and now I'm able to actually have permission to actually send that message to the other TTY and now it's going to ask for a message. Now I'm going to write yo dog exclamation hit enter but I'm still not done because we have to send that end of file signal. So you can do this with either control C or control D, control D is typically what you want to do here. And if I go back to TTY 3, I should see my message yo dog. So write is kind of convenient. You really don't need the right command though. I mean if you wanted to let me who again you can see DT on TTY 3 DT TTY 4. You could actually just use the echo command to write to somebody. You could echo and I could say hi there and then what I could do is I could direct that so I'm going to do a greater than sign, a single greater than sign. I'm going to direct that to TTY 4 and let me go back to TTY 4 and I don't see the message because I think I should have specified the full path there. Let me up arrow. So instead of just echoing hi there and directing it to TTY 4, the full path to your TTYs are typically slash dev slash TTY whatever number TTY 4 in this case. And now that I've done that let me go back to TTY 4 and there you go see that hi there. Now let me go ahead and switch to a TTY 5 login for a third time. Let me show you another command. So the right command is useful if you're writing to a single other user on the system. What if you want to message all the users currently logged in on the system? Well, you can't really do that with write but there is another command called wall which is very similar. It's just when you do a wall message everyone gets it. So I could do for example wall and I could hit enter and it's the blinking cursor again right and I can say hi everybody and then hit enter and then once again control D to send that end of file signal and you can see I get the message on TTY 5. I also get the message on TTY 4 and if I switch to TTY 3 I also get the message on TTY 3 and if I do a control C to get back to the prompt here let me do a man on wall. Like the right command not much to it. The wall command once again there's really not much to it. These are really simple utilities. They're standard Linux utilities. Matter of fact they're not part of the new core utils but they are part of the standard util-linux package which is a standard package of command line utilities that are typically installed on every Linux system. So there you have it. Not much to these commands. I showed you a little bit of what you can do with write, wall, MESG so again if you don't have permissions MESG space Y for yes to allow people to message you and then of course I also showed you by accident really it wasn't the purpose of this video but how to change the console font for your TTY because I know most TTYs of their default fonts are very tiny so it's nice to be able to increase that on most machines. Now before I go I need to thank a few special people. I need to thank the producers of this episode Gabe James Met, Maximum at Mitchell, Paul West, Wanya Bald, Homie, Alex, Armoredragon, Chuck, Commander Henry, Diokai, George Lee, Mars, Drum, Nader, Yon, Alexander, Paul, Peace, Archon, Fedora, Polytech, Realite, Tees, Feliz, Red Prophet, Roland, Steven, Tools, Devler, and Willie these guys they're my heist here patrons over on Patreon without these guys this episode would not have been possible. The show is also brought to you by each and every one of these fine ladies and gentlemen as well. All these names you're seeing on the screen right now these are all my supporters over on Patreon because without these guys I wouldn't be able to do what I do you know I don't have any corporate sponsors I depend on you guys if you like my work and want to see more videos about Linux and free open source software subscribe to distro tube over on Patreon peace.