 Okay. Can everyone hear me okay? Okay. So welcome back. I'm going to address a couple of items in the administrative. With the end of the first week, we sent an email noticing you that we have uploaded the videos for the first week. So you can now find them online. They have all the screen recordings for the things that we were doing. So you can go back to them, look if you were confused about we did something quick and again, feel free to ask us any questions if anything in the lecture notes is not clear. We also send you a survey so you can give us feedback about what was not clear, what items you will want to a more thorough explanations, or just any other item if you're finding the exercises too hard, too easy, go into that URL and we'll really appreciate getting that feedback because that will make the course better for the remaining lectures and for future iterations of the course. With that out of the way, and we're going to try to upload the videos in a more timely manner. We don't want to wait until the end of the week for that. So keep tuned for that. That out of the way. Now, I'm going to, these lectures call command line environment and we're going to cover a few different topics. So the main topics we're going to cover. So you can keep track, it's probably here, keep track of what I'm talking. The first is going to be job control. The second one is going to be terminal multiplexers. Then I'm going to explain what dot files are and how to configure your cell, and lastly how to efficiently work with remote machines. So if things are not fully clear, keep the structure there. They all kind of interacting some way of how you use your terminal, but they're somewhat separate topics. So keep that in mind. So let's go with job control. So far we have been using the cell in a very kind of a monocomment way. Like you execute a command and then the command executes and then you get some output and that's all about what you can do. And if you want to use, you want to run several things, it's not clear how will you do it. Or if you want to stop the execution of a program, it's again like, how do I know how to stop a program? Let's, it's okay this with a command called sleep. Sleep is a command that takes an argument and that argument is going to be an integer number and it will sleep. It will just kind of be there on the background for that many seconds. So if we do something like sleep 20, this process is going to be sleeping for 20 seconds. But we don't want to wait 20 seconds for the command to complete. So what we can do is type control C. By typing control C, we can see that the here, the terminal kind of let us know in this, be one of the syntax that we cover in the editor's last beam lecture, that we type control C and it's stopped the execution of the process. What is actually going on here is that this, this is using a Unix communication mechanism called signals. When we type control C, what the terminal did for us, what the cell did for us, is send a signal called SIGINT that stands for kind of signal interrupt that tells the program to stop itself. And there are many, many, many signals of this kind. And if you do man signal and just go down a little bit, here you have a list of them. They all have like number identifiers. They have kind of a short name and you can find a description. So for example, the one I have described is here, number two SIGINT. This is the signal that a terminal will send to a program when it wants to interrupt its execution. A few more to kind of be familiar with is SIGQUIT. This is again, if you want, if you are from a terminal and you want to quit the execution of a program, which for most programs will do the same thing. But we're going to showcase now a program which will be different. This is the signal that will be sent. It can be confusing sometimes kind of looking at these signals. For example, the SIG term is for most cases equivalent to SIGINT and SIGQUIT, but this is when it's not sent through a terminal. A few more that we are going to cover is SIGUP. It's when there's like a hang up in the terminal. So for example, when you are in your terminal, if you close your terminal, there are still things running in the terminal. That's the signal that the program is going to send to all the processes to the lead that they should close. There was a hang up in the command line communication and they should close up. Singles can do more things that they are stopping, like interrupting programs and asking them to finish. You can for example use the SIGSTOP to pause the execution of a program, and then you can use the SIGCOMD to continue the execution of that program at a point later in time. Since all of these might be slightly too abstract, let's see a few examples. First, let's showcase Python program. I'm going to very quickly go through the program. This is a Python program, and unlike most Python programs, it's importing this signal library, and it's defining this handler here, and this handler is writing, oh, I got a SIGINT, but I'm not going to stop here. After that, we tell Python in a way that we want this program when it gets a SIGINT to stop, and the rest of the program is a very silly program that is just going to be printing numbers. So let's see this in action. We do Python SIGINT and it's counting. We try doing control C, this sends a SIGINT, but the program didn't actually stop. This is because we have a way in the program of dealing with this exception, and we didn't want to exit. If we send a sequit which is done through control-backlass here, we can see that since the program doesn't have a way of dealing with sequit, it does the default operation, which is terminate the program. You could use this for example, if someone control C is your program, and your program is supposed to do something like, you maybe want to save the intermediate state of your program to a file, so you can recover it from later. This is how you will write like a handler like this. Can you repeat the question, sir? What did you type right now when it stopped? So first, so what I type is, I type control C to try to stop it, but it didn't because SIGINT is captured by the program, and then I type control-backlass, which sends a sequit, which is like a different signal, and the signal is not captured by the program, and it's also worth mentioning that there's a couple of signals that cannot be captured by software. There's a couple of signals, these are SIGKIL and that cannot be captured. That one will terminate the execution of the process no matter what, and it can be sometimes harmful. You don't want to be using by default because this can leave for example orphan children processes. Like if a process has other like small children processes that is started and you SIGKIL it all of those will keep running in there, but they won't have a parent, and you can might have really good behavior going on. Go ahead. What signal is given to the programming for you that's a log off? If you log off, that will be, for example, if you're in a SSH connection, and you close the connection, that is the hang-up signals like C, H, up, which I'm going to cover in examples or at least what will be sent up, and you could write for example, if you want the process to keep working, even if you close that, you can write a wrapper on that to ignore that thing. Let's display what we could do with the stop and continue. So for example, we can start a really long process, as leap a thousand, I'm going to take forever. We can control C, control set, sorry. If we do control set, we can see that the terminal is saying, oh, it's suspended. What this actually meant is that this process was sent a six stop signal, and now it's still there. You can continue execution, but right now it's completely stopped and it's in the background. We can launch a different program. If when we try to run this program, please notice that I have included an ampersand at the end. This tells us that I want this program to start running in the background. This is related to all these concepts of running programs in the cell, but background it and what is going to happen is the program is going to start, but it's not going to take over my prompt. Like if I just run this command without this, I could not do anything. Like I will not have access to the prompt until the command either finished or I ended it abruptly. But if I do this, it's saying, oh, like there's a new process, which is this is the process and if I number and we can ignore this for now. If I type the command jobs, I get the output that I have a suspended job that is the sleep, thousand job, and then I have another running job, which is this know-how sleep 2000. Say I want to continue the first job, like the first job is suspended but it's not executing anymore. I can continue that doing BG percentage one. That percentage is referring to the fact that I want to refer to this specific process. Now if I do that and I look at the jobs, now this job is running again. Now both of them are running. If I wanted to stop this job, I can use the kill command. The kill command, my thing is for killing jobs, which is just like stopping them intuitively, but actually it's really useful. Like the kill command just allows you to send any sort of unique signal. So here, for example, instead of killing it completely, we just send a stop signal. Here I'm going to send a stop signal, which is going to pause the process again, and now I still have to include an identifier because without the identifier, the cell wouldn't know where to stop the first one or the second one. Now let's say this has been suspended because there was a signal sent. If I do jobs again, we can see that the second one is running and the first one has been stopped. Going back to one of the questions was, what happens when you close the cell, for example, and why sometimes people will say that you should use this no-hsup command before you run jobs in a remote session. This is because if we try to send a hang-up command to the first job, it's gonna, in the similar fashion as the other signals, it's gonna hang it up and that's gonna terminate the job and the first job isn't there anymore, whereas we have still the second job running. However, we try to send the signal to the second job, what will happen if we close our terminal right now, is it's still running. No-hub, what it's doing is kind of encapsulating whatever command you're executing and ignoring whatever you get, like a signal, like a hang-up signal and just ignoring that so it can keep running. And if we send the kill signal to the second job, that one can be ignored and that will kill the job no matter what and we don't have any jobs anymore. Kind of completes the section on job control, any questions so far, any anything that wasn't kind of fully clear. So BG, just like there are two commands, whenever you have a command that has been backgrounded and doesn't, it's not, it's stopped, you can use BG, so for background, to continue that process running on the background, that's equivalent of just kind of sending it a continuous signal so it keeps running and then there's another one which is called FG, if you want to kind of recover it to the foreground and you want to reattach your standard output. Okay, good. Jobs are useful and in general, I think the kind of knowing about signals can be really beneficial when dealing with some part of Unix, but most of the time, what you actually want to do is something along the lines of having your editor in one side and then the program in another and maybe monitoring what the resource consumption is in our tab. We could achieve this using probably what I have seen a lot of time, which is just opening more windows, we can keep opening terminal windows, but the fact is they're kind of more convenient solution to this and this is what a terminal multiplexer does. A terminal multiplexer, like T-Mux, will let you create different work spaces that you can work in and quickly kind of, this has like a huge variety of functionality. It will let you kind of rearrange the environment and it will let you have different sessions. There's another moral, older command which is called screen that might be more readily available, but I think the concept is kind of extrapolate to both. We recommend T-Mux that you go and learn it and in fact, we have exercises on it. I'm gonna kind of showcase the functionality right now. So whenever I told, oh, let me make a quick note, there are kind of three core concepts in T-Mux that I'm gonna go through and the main idea is that there are, what it's called sessions. Sessions have windows and windows have panes. And it's gonna be kind of useful to keep this hierarchy in mind. You can pretty much equate windows to what tabs are in other editors and other like, for example, your web browser. I'm gonna go through features, mainly what can you do at the different levels. So first, when we do T-Mux, that starts a session and here and now seems like nothing changed, but what's happening right now is where within a cell that's different from the one we started before. So our original cell started a process that is T-Mux and that T-Mux started a different process which is the cell we're currently in. And the nice thing about this is that that T-Mux process is separate from the original cell process. So here we can do things, we can do ls-layer, for example, to list what is going on in here. And then we can start running our program and it will start running in there and we can do control-ad, for example, to detach, let me, I can enable, start casting, yeah, let me. To detach from the session and if we do T-Mux A, that's gonna reattach us to the session. So the process, we abandon a process kind of counting number, this like really silly Python program that was just counting numbers, we like left it running there and if we T-Mux A, like the process is still running there and we could close this entire terminal and open a new one and we could still reattach because this T-Mux session is still running. Again, we can, ah, before I go any further, pretty much unlike BIM where they have this notion of modes, T-Mux will work in a more maxi way which is pretty much every command in T-Mux, so every, yeah, pretty much every command in T-Mux, you could enter it through the command line that we could use, but I recommend you to get familiar with the key binds. It can be somehow an intuitive at first, but once you get used to them, let's see this is gonna, ah. When you get familiar with them, you will be much faster just using the key bindings than using the commands. One note about the key bindings, all the key bindings have a form that is like you type a prefix and then some key. So for example, to detach, we do control A and then D. This means you press control D first, you release that and then press D to detach. On default T-Mux, the prefix is control B, but you will find that most people will have this from up to control A because it's much more ergonomic type on the keyboard. You can find more about how to do these things in one of the exercises where we link you to the basics and how to do some kind of quality of life of modifications to T-Mux. Going back to the concept of sessions, we can create like a new session, just doing something like T-Mux new and we can give a session's name, so we can do like T-Mux new foobar and this is a completely different session that we have started. We can work here, we can detach from it, T-Mux LS will tell us that we have two different sessions. The first one is named zero because I didn't give it a name and the second one is called foobar. And I can attach the foobar session and I can end it. It's really nice because having this, you can kind of work in completely different projects. For example, having two different T-Mux sessions and have different like editor sessions, different processes running. When you go through, when you are within a session, we start with the concept of windows. Here we have a single window, but we can use control A, C for create to open a new window. And here, nothing is executing, what is doing T-Mux has opened a new cell for us and we can start running another one of these programs here. And to quickly jump between the tabs, we can do control A and previous, like P for previous, and that will go as to the previous window, control A next to go to the next window. You can also use the numbers. So if we start opening a lot of these tabs, we could use control A one to specifically jump to the window that is number one. And lastly, it's pretty useful to know sometimes that you can rename them. For example, here I'm executing this Python process, but that might not be really informative and I maybe want to have something like execution or something like that. And that will rename the name of that window so you can have this very neatly organized. This still doesn't solve the need when you want to have two things at the same time in your terminal. Like in the same display, this is what pains are for. Right now here we have a window with a single pane, all the windows that we have opened so far have a single pane, but if we do control A double quotes, this will split the current display into two different panes. So you see like the one we open below is a different cell from the one we have above and we can run any process that we want here. We can keep splitting this. We do control A percentage that will split vertically and you can kind of rearrange these tabs using a lot of different commands. One that I find is very useful when you are starting and it's kind of frustrating rearranging them. Oh, before I explain that, to move through these panes, which is something you want to be doing all the time, you just do control A and the arrow keys and I will let you quickly kind of navigate through the different windows and execute again, like I'm doing a lot of LS minus A, but I don't have, I can do H stop that we explain in the debugging and profiling lecture. And we can just navigate through them. Again, like to rearrange this another slew of commands, you will go through some in the exercises. Control A space is pretty neat because it will kind of equi-space the current ones and let you through different layouts. Some of them are too small for my current terminal config, but that covers, I think like most of the, oh, there's also here, for example, the, this beam execution that we have started is too small for what the current T-Max pane is. So one of the things that really is much more convenient to do in T-Max contrast to having multiple terminal windows is that you can zoom into this. You can ask by doing control A C set for zoom, it will expand the entire pane to take over all the space and then control A set again will go back to it. Any questions for terminal multiplexers or like T-Max concretely? Yeah, there isn't, like it wouldn't be any different from having two terminal windows opening your computer. Like both of them are gonna be running. Of course, like when it gets to the CPU, this is gonna be multiplex again. Like there's like a time-serial mechanism going there, but there's no different. Like T-Max is just making this much more convenient to use by giving you this kind of visual layout that you can quickly manipulate through. And one of the main advantages will come when we reach the remote machines because you can leave one of these, we can detach from one of these T-Max sessions, close the connection. And even if we close the connection and the terminal is gonna send a hang up signal, that's not gonna close all the T-Max session that has been started. Any other questions? And let me disable the kickaster. So now we're gonna move into the topic of dot files and in general how to kind of configure your cell to do the things you want to do and mainly how to do them quicker and in a more convenient way. I'm gonna motivate this using aliases first. So what an aliases is that by now you might be starting to do something like, a lot of the time I just want to LS a directory and I want to display all the contents in the list format and in a human readable thing. And it's fine, like it's not the long of a command but as you start building longer and longer commands it can become kind of bothersome having to retype them again and again. This is one of the reasons why aliases are useful. Aliases is a command that will be a built in in your cell and what it will do is it will remap a short sequence of characters to a longer sequence. So if I do for example here alias ll equals LS minus LAH what this, if I execute this command this is gonna call the alias command with this argument and the alias is gonna update the environment in my cell to be aware of this map. So if I now do ll it's executing that command without me having to type the entire command. They can be really handy for very many reasons. One thing to note before I go any further is that here alias is not anything special compared to other commands. It's just taking a single argument. So and there is no space around these equals and that's because alias takes a single argument and if you try doing something like this that's giving it more than one argument and there's no one at work because that's not the format it expects. So other use cases that work for aliases as I was saying for some things it might be much more convenient like one of my favorite is git status it's extremely long I don't like typing the long of a command every so often because you end up typing all over time so gs will replace for doing the git status. You can also use them to alias things that you'd mis-type often so you can do sl equal ls that will work. Other useful mappings are you might want to alias a command to itself but with a default flag. So here what is going on is I'm creating an alias which is an alias for the move command which is mv and I'm aliasing to the same command but adding the minus i flag. And this minus i flag if you go through the man page and look at it it stands for interactive and it will what it will do is it will prompt me before I do an override. So once I have executed this I can do something like oh I want to move aliases into case by default move won't ask and if case already exist it will be oh that's fine I'm gonna override whatever that's there but here is now expanded move has been expanded into this move minus i and is using that to ask me oh are you sure you want to override this. And I can say no I don't want to lose that file. Lastly you can use alias move to ask for what this alias stands for. So like we'll tell you so you can quickly make sure that what the command that you are actually executing is. One inconvenient part about for example having aliases is how will you go about persisting them into your current environment. Like if I were to close this terminal now all these aliases will go away and you don't want to be kind of re-typing these commands and more generally if you start configuring yourself more and more you want some way of bootstrapping all these configuration. You will find that most in cell com programs will use some sort of text text base configuration file and this is what we usually call dot files because they start with a dot for historical reasons. So for bus in our case which is a cell we can look at the bus RC. And for demonstration purposes here I have been using csh which is a different cell and I'm going to be configuring bus and starting bus. So if I create an entry here and I say oh a cell maps to less and I have modified that and now I start bus. Bus is kind of completely un-configured but now if I do a cell that's unexpected. You're not in your home directory. Oh good, good, good. So it matters where your config file is and your config file needs to be in your home folder. So the configuration file for bus will live in the tilde which will expand to your home directory and then bus RC. And here we can create the alias and now if we start a bus session and we do a cell now it has been loaded and this is telling that like it's loaded at the beginning when this bus program is started and all this configuration is loaded. And you can not only use analysis you can add a lot of parts of configuration. So for example here I have a prompt which is fairly useless. Like it has just given me the name of the cell which is bus and like the person which is five oh a half. I don't want this to be displayed. As with many things in your cell this is just an environment variable. So the PS1 is just what the prompt string for your prompt and we can actually modify this to just be a greater than symbol. And now that had been modified and we have that but if we exit and call bus again that was lost. However if we add this entry and say oh we want PS1 to be this and we call bus again this has been persisted and we can keep modifying this configuration. So maybe we want to include where the working directory that we are seeing and that's telling us the same information that we had in the others. And there are many, many options like cells are highly, highly configurable and it's not only cells that are configured through these files there are many other programs as we saw for example in the editor's lecture BIM is also configured this way. We gave you this BMRC file and told you to put it in your under home dot BMRC and this is the same concept but just for BIM it's just giving it a set of instructions that is to load when it's started so you can keep a configuration that you want. And even non kind of like a lot of programs will support this. For instance my terminal emulator which is another concept which is the program that is running the cell in a way and displaying this into the screen in my computer can also be configured this way. So if I modify this I can change this size of the font like right now for example I have increased the font size a lot so for demonstration purposes but if I change this entry and make it for example 28 and write this value you're seeing that the size of the font has changed because I edited this text file that specifies how my terminal emulator should work. Any questions so far with dot files? Okay it can be a bit daunting kind of knowing that there is like this endless world of configurations and how do you go about learning about what can be configured? The good news is that A we have linked you like to really good resources in the lecture notes but the main idea is that a lot of people really like just configuring these tools and have uploaded the configurations files to GitHub another different kind of repositories online so for example here we're on GitHub we search for dot files and can see that there are like thousands of repositories of people sharing their configuration files. We have also like the class instructors have linked our dot files so if you really want to know how any part of our setup is working you can go through it and try to figure out you can also feel free to ask us if we go for example to this repository here we can see that there's many many files that you can configure for example there is one for BAS first example one for Git that will probably be covered in the version control lecture tomorrow. If we go for example to the BAS profile which is a different form of what we saw in the BAS RC it can be really useful because you can learn through doing just looking at the manual page but the manual pages in a lot of the time are just kind of like a descriptive explanation of all the different options and sometimes it's more helpful going through examples of what people have done and trying to understand why they did it and how it's helping their workflow and we can say here that this person has done casing sensitive gloving that we covered gloving as this kind of file name expansion trick in the cell scripting on tools and here you say no I don't want this to be kind of married whether you've seen uppercase and lowercase and just setting this option in the cell for these things to work this way. Similarly there is for example Alesis here we can see a lot of Alesis that this person is doing example D for CD because that's like for Dropbox sorry for because that's just much shorter G for Git same will go for example with B-Mercy it can be actually very very informative going through this and try to extract useful information. We do not recommend just kind of getting one huge blob of this and copying this into your config files because maybe things are prettier but you might not really understand what is going on. Lastly one thing I want to mention about dot files is that people not only try to push this files into GitHub just so other people can read it that's one reason they also make really sure they can kind of reproduce their setup and to do that they use a slew of different tools oops went a little too far there here. So genius.to is for example one of them and the trick that they are doing is they are kind of putting all their dot files in a folder and they are kind of faking to the system using a tool called SimLynx that they are actually where they are not. I'm gonna draw really quick what I mean by that. So a common folder structure might look like you have your home folder and in this home folder you might have your bus or C that contains your bus configuration you might have your B-Mercy and it would be really great if you could keep this under version control but the thing is you might not want to have a Git repository which will be covered tomorrow in your home folder. So what people usually do is they create a dot files repository and then they have entries here for their bus or C and then B-Mercy and this is where the actually like the files are where they are doing is they're just telling the OS to forward kind of like whenever anyone wants to read this file or write to this file just forward this to this other file. This is a concept called SimLynx and it's useful in this scenario but in general it's a really useful tool in Unix that we kind of haven't covered so far in the lectures but you might be that you should be familiar with and you know the syntax will be ln minus s for specifying a symbolic link and then you will put the kind of the path to the file that you want to create and then the SimLynx that you want to create and all these kinds of fancy tools that we're seeing here listed they all amount to doing some sort of this trick so that you can have all your dot files need and tidy into a folder and then they can be version control and then they can be SimLynx so the rest of the programs can find them in their default locations. Any questions regarding dot files? So what you will have is pretty much every program for example bus will always look for home bus or C that's like where the program is gonna look for. What you do when you do a SimLynx is you place like your home dot bus or C is just a file that is kind of a special file in Unix that says oh whenever you want to read this file go into this other file and there's no content like there's no like your aliases are not part of this file that file is just kind of like a pointer saying that you should go that other way and by doing that you can have your other file in that other folder. If version controlling is not useful think about what if you want to have them in your Dropbox folder so like they're synced to the cloud for example that's kind of another use case where like SimLynx could be really useful. So you don't need the whole SimLynx to go somewhere else? As long as you have a way for the kind of the default path to resolve wherever you have it and last thing I want to cover in the lecture oh sorry any other questions about dot files? Last thing I want to cover in the lecture is working with remote machines which is a thing that you will run earlier so like sooner or later and those are a few things that will make your life much easier when dealing with remote machines if you know about them and right now maybe because you're using the Athena cluster but like later on in your programming careers pretty sure that there's a fairly ubiquitous concept of having your kind of local working environment and then having some production server that is actually running the code which is really good to get familiar about how to work in with remote machines. So the main command for working with remote machines is SSH SSH is just like a secure cell is just gonna take the responsibility for kind of reaching whatever we tell it to go and trying to kind of open a session there. So here the syntax is JJGO is the user that I want to use in the remote machine and this is because the user is different from the one I have in my local machine which will be the case a lot of the time then the ad is telling the terminal that this separates what the user is and what the address is. Here I'm using an IP address because what I'm actually doing is I have a virtual machine in my computer that is the one that is remote right now and I'm gonna be SSHing into it this is the URL that I'm using sorry the IP that I'm using but you might also see things like oh I want to SSH as JJGO foobar mit.edu that's probably something more common if you're using some remote server that has a DNS name. So going back to our regular command we try to SSH as cast for a password really common thing and now we're there we have we are still in our same terminal emulator but right now where SSH is kind of forwarding the entire virtual display to display what the remote cell is displayed and we can execute commands here and we'll see the remote files a couple of handy things to know about SSH that were briefly covered in the data wrangling lecture that SSH is not only good for just opening connections it will also let you just execute commands remotely so for example if I do that it's gonna ask me where's my password again and it's executing this command then coming back to my terminal and piping the output of what the command was in the remote machine through the standard output in my current cell and I could have this in I could have this in a pipe and this will work and we'll just drop all this output and then have a local pipe where I can keep working so far it has been kind of inconvenient having to type our passwords there's one really good trick for this is we can use something called SSH keys SSH keys just uses a public key encryption to create like a pair of SSH keys public key and a private key and then you can give the server the public part of the key so that you copy the public key and then whenever you try to authenticate instead of using your password it's gonna use the private key to prove to the server that you're actually who you say you are we're gonna, we can quickly so case how will you go about doing this right now I don't have any SSH keys so I'm gonna create a couple of them first thing is just gonna ask me where I want this key to live as a person is doing this this is my home folder and then is using this dot SSH path which refers back to the same concept that we covered earlier about having dot files like dot SSH is a folder that contains a lot of the configuration files for how you want SSH to behave so it will ask us a passphrase the passphrase is to encrypt the private part of the key because if someone gets your private key if you don't have a password protected private key if they get that key they can use that key to impersonate you in any server whereas if you add a passphrase they will have to know what the passphrase is to actually use the key and as created a keeper we can check that these two files are now under SSH and we can see too small for this and we have these two files have the 255.19 and the public key and if we cut through the output that key is actually is not like any fancy binary file it's just a text file that has the contents of the public key and some alias name for it so we can know what this public key is and the way we can tell the server that we are authorized to SSH there is just actually copying this file like putting this string into a file that is SSH authorized host so if we hear what I'm doing is I'm cutting the output of this file which is just this line of text that we wanna copy and I'm piping that into SSH and then remotely I'm asking T to dump the contents of the standard input into SSH those authorized keys and if we do that obviously it's gonna ask us for a password and it was copied and now we can check that if we try to SSH again it's gonna first ask us for a passphrase but you can arrange that so that's saved in the session and we didn't actually have to type the key for the server and I can kind of show that again why it's not saving more things are as useful though we can do if that command seemed like a little bit janky you can actually use this command that is built for this so you don't have to kind of craft this SSH T command that is just called SSH copy AD and we can do the same and it's gonna copy the key and now if we try to SSH we can SSH without actually typing any key at all or any password more things we will probably want to copy files you cannot use CP but you can use SCP for kind of like SSH copy and here we can specify that we want to copy this local file called notes and the syntax is kind of similar we want to copy it to this remote and then we have a semicolon to separate what the path is gonna be and then we have, oh, we want to copy this as notes but we could also copy this as forward and if we do that has been executed and is telling us that all the contents have been copied there if you're gonna be copying a lot of files there is a bear command that you should be using that is called ARSYNC sample here yes, it's specifying these three flags I'm telling ARSYNC to kind of preserve all the permissions whenever possible to try to check if the file has already been copied for example, SCP will try to copy files that are already there this will happen for example if you're trying to copy and the connection interacts in the middle of it SCP will start from the very beginning trying to copy every file whereas ARSYNC will continue from where it started and here we ask it to copy the entire folder and it's just really quickly copied the entire folder one of the other things to know about SSH is that the equivalent of the dot file for SSH is the SSH config so if we edit the SSH config to be, let's see, I have to copy it, right? Okay, let's be in the config if I edit the dot SSH config to look something like this instead of having to every time type SSH, JG go like having this real long string so I can like refer to the specific remote I want to refer with the specific username I can have something here like say, oh, this is the username this is the host name that this host is referring to and you should use this identity file and if I copy this, this is right now in my local folder I can copy this into SSH now instead of having to do this real long command I can just say, oh, I just want to SSH into the host called VM and by doing that, it's grabbing all that configuration from the SSH config and applying it here and this solution is much better than something like creating an alias for SSH because other programs like SCP and Arsync also know about the dot files for SSH and we'll use them whenever they are there Last thing I want to cover about remote machines is that here, for example, we'll have TMAX and we can, like I was saying before we can start editing some file and I'll copy it B and we can start running some job, of course and what, oh, and for example something like H-stop and this is running here we can detach from it, close the connection and then SSH is back and then if you do Timux A, everything is as you left it like nothing has really changed and like if you have things executing there in the background, it will keep executing I think that pretty much ends all I have to say for this tool. Any questions related to remote machines? How do you deal with that? That's a really good question so what I do for that, and I can't Oh, sorry, so the question is how do you deal with trying to use Timux in your local machine and also trying to use Timux into remote machine? There are a couple of tricks for dealing with that the first one is changing the prefix so what I do, for example, is in my local machine the prefix I have changed from control B to control A and then in the remote machines this is still control B so I can kind of swap between like if I want to do things to the local Timux I will do control A and if I want to do things to the remote Timux I will do control B and another good thing that I did you can have separate conflicts so I can do something like this and then probably that, because I don't have my SSH config but if you, I can just SSH BN here what you see the difference between these two bars for example is because the Timux config is different as you will see in the exercises the Timux configuration is in the dot Timux dot com and no, there's no CDN and Timux dot com and here you can do a lot of things like changing the color depending on the host you are so you can get like quick visual feedback about where you are or like if you have a nested session also Timux will, if you're in the same host and you try to Timux within a Timux session it will kind of prevent you from doing it so you don't run into issues any other questions related to kind of all the topics we have covered another answer to that question is also if you type the prefix twice it sends it once to the underlying shell so the local binding is control A and the remote binding is control A you can type control A, control A and then D for example D catch from the remote okay I think that ends the class for today there's a bunch of exercises related to all these main topics we're gonna be holding office hours today too so feel free to come and ask us any questions