Terminal Lesson 11
M kids, here today I'm just going to be showing you a quick tutorial on how to run an executable like something that you've made with chmod +x
from a terminal. Some of you have had issues with opening something from your desktop; well, I'm going to show you how to run stuff right through a terminal.
First of all, I'm going to cd
to my desktop because I have these nice two great executables on my desktop. And, um, I'm going to be showing you how we are going to run them. First of all, I'm going to be running screen_saver
. Right now, I'm going to type pwd
, and I'm going to do this two ways.
First of all, I'm going to do ./screen_saver
, and .
just means my current path. So that's /home/user/Alex/desktop/screen_saver
, and all I have to do is type the p
of the executable, and now my screen_saver
program is running like such. Um, so I'm just going to ctrl+c
out of this, and, um, now I can also just type the full path like /users/user/Alex/desktop/screen_saver
and that's the full path of it. I just hit enter
, and it'll start running.
So now, um, I can also do this for crash_screen
, which is another executable I have here on my desktop. So let's start by typing /home/user/Alex/desktop/crash_screen
. Now, I have to type the... I don't have to type the full path; I could just put .
there instead of this scrap. So yeah, I hit enter, and my crash_screen
program is running like such.
Um, so I've just showed you how to launch an executable from the terminal. I'm going to explain one more thing to you that, um, when you start an executable, you can't just be say I'm in my desktop, and there's something crash_screen
. You have to still type the path of crash_screen
, like /crash_screen
. At least, you can't just type crash_screen
or it'll think crash_screen
is a standard command. You have to type the path of it like /crash_screen
.
So, yeah, now I'm just going to cd ..
back to my home directory. cd ..
goes back, and it actually goes back by one directory. So if I was in /home/user/Alex/desktop
, it would go back to /home/user/Alex
and take off the desktop. So now I'm back here in my home directory. Doing /crash_screen
won't work anymore because those executables are on my desktop, and this is my home directory.
So what I could do, there are two ways. I can either type /home/user/Alex/desktop/crash_screen
to launch crash_screen
that's on my desktop, or I could type ~/desktop/crash_screen
. What that will do is it's going to take my home directory and that's going to be good enough to launch it.
So now, um, yeah, that's how to do it. It's, um, very simple and easy. Um, thanks for watching, M kids, and subscribe...