﻿1
00:00:00,700 --> 00:00:01,450
‫Welcome back.

2
00:00:02,140 --> 00:00:10,540
‫This short video is for those who haven't really worked with Linux and Mac OS Terminal or Windows Command

3
00:00:10,540 --> 00:00:11,020
‫prompt.

4
00:00:11,440 --> 00:00:20,110
‫So if you are like me some years ago who hasn't really encountered terminal or command prompt, then

5
00:00:20,110 --> 00:00:21,130
‫this video is for you.

6
00:00:21,760 --> 00:00:28,870
‫If you are familiar with terminal or command prompt, then please skip the video.

7
00:00:29,410 --> 00:00:38,440
‫This video is really for people who have almost never encountered Linux Terminal or Windows Command

8
00:00:38,440 --> 00:00:48,640
‫prompt or Mac OS Terminal, both the terminal in Linux and the Mac OS, and then the command prompt

9
00:00:48,640 --> 00:00:49,540
‫in Windows.

10
00:00:50,140 --> 00:00:51,340
‫They're very similar.

11
00:00:51,850 --> 00:00:58,810
‫And in this course, I recommend you to use terminal or command prompt to run Python files.

12
00:00:59,410 --> 00:01:08,200
‫And so I'm going to give you a short explanation of how to use terminal or command prompt for the purposes

13
00:01:08,200 --> 00:01:09,100
‫of this course.

14
00:01:09,370 --> 00:01:16,270
‫Essentially, I want you to know how to launch Python programs using terminal or command prompt.

15
00:01:16,720 --> 00:01:21,250
‫So if you look at the screen, then you know that I'm in my desktop.

16
00:01:21,790 --> 00:01:25,120
‫And so now I'm going to go into my default home folder.

17
00:01:25,630 --> 00:01:32,680
‫So you see that I'm in my default home folder and then I have a lot of files here and now from this

18
00:01:32,680 --> 00:01:34,270
‫default home folder.

19
00:01:34,930 --> 00:01:41,620
‫I want to enter into my desktop folder, and my desktop folder is right here, so I'm going to click

20
00:01:41,620 --> 00:01:41,830
‫it.

21
00:01:42,430 --> 00:01:46,960
‫And you see, I have my files here, these files that you see here.

22
00:01:47,560 --> 00:01:49,750
‫These are these files here.

23
00:01:50,260 --> 00:01:51,430
‫So it's the same thing.

24
00:01:51,940 --> 00:01:58,180
‫And now let's say that I want to go back into my default home folder, so I'm going to go here.

25
00:01:58,810 --> 00:01:59,260
‫OK?

26
00:01:59,770 --> 00:02:05,200
‫This is how most people in the world use computers.

27
00:02:05,770 --> 00:02:09,730
‫However, there is another way to navigate through these folders.

28
00:02:10,120 --> 00:02:13,600
‫Here I have my terminal and in windows.

29
00:02:13,930 --> 00:02:16,260
‫It would be command prompt.

30
00:02:16,750 --> 00:02:19,330
‫And in macOS you also have a terminal.

31
00:02:19,780 --> 00:02:27,250
‫And so I have opened my terminal and actually here inside my terminal, I'm inside my home folder so

32
00:02:27,250 --> 00:02:28,960
‫I can write here else.

33
00:02:29,560 --> 00:02:34,060
‫And that command will show me all the files that I have in my home folder.

34
00:02:34,630 --> 00:02:35,380
‫And there you go.

35
00:02:35,410 --> 00:02:37,450
‫You see, I have all my files here.

36
00:02:37,990 --> 00:02:42,090
‫And by the way, if you are in windows, then you don't write else.

37
00:02:42,400 --> 00:02:43,690
‫You write dear.

38
00:02:44,290 --> 00:02:45,880
‫But in Linux, you write less.

39
00:02:51,520 --> 00:03:01,480
‫So being here is the same like being here now, if I don't want to see those files anymore, then I'll

40
00:03:01,480 --> 00:03:02,590
‫just write clear.

41
00:03:03,250 --> 00:03:12,550
‫And now, just like we went from our default home folder into our desktop folder and then we went back

42
00:03:12,550 --> 00:03:14,110
‫to our home folder.

43
00:03:14,710 --> 00:03:22,000
‫What we did, we navigated through folders, but we can also do it through the terminal and we do like

44
00:03:22,000 --> 00:03:23,530
‫this seed.

45
00:03:24,460 --> 00:03:26,950
‫And then we write desktop.

46
00:03:27,460 --> 00:03:31,390
‫And now what we have done, we have done this.

47
00:03:31,720 --> 00:03:41,980
‫We have entered into our desktop folder, but through our terminal and by the way, in Windows and in

48
00:03:41,980 --> 00:03:44,440
‫Mac OS, it's the same thing.

49
00:03:45,100 --> 00:03:48,470
‫If you want to change your folder in Windows, you write code.

50
00:03:49,390 --> 00:03:51,940
‫And the same thing applies to Mac OS.

51
00:03:52,570 --> 00:03:57,820
‫And now if I want to see what I have inside my desktop, then I write less.

52
00:03:58,450 --> 00:04:00,970
‫And you can see I have the same files here.

53
00:04:01,570 --> 00:04:08,680
‫So right now, I'm in my desktop folder, in my screen and also in my terminal.

54
00:04:09,190 --> 00:04:13,210
‫And now let's say that I want to enter my folder here.

55
00:04:13,510 --> 00:04:18,970
‫So you see, I have more files here, and I can do the same thing in my terminal.

56
00:04:19,450 --> 00:04:23,350
‫I write code, which is change directory.

57
00:04:23,920 --> 00:04:28,810
‫And then the name of the folder empty copied Udemy course.

58
00:04:29,410 --> 00:04:39,490
‫And by the way, in terminal, you can complete the names of the folders or the files with a tap button.

59
00:04:40,090 --> 00:04:48,510
‫So, for example, I have only written this part and then I click the tap button and it has auto completed

60
00:04:48,520 --> 00:04:53,680
‫the name of the folder and then I click Enter and I'm inside the folder.

61
00:04:54,310 --> 00:04:55,440
‫I write else.

62
00:04:56,020 --> 00:05:06,910
‫And as you can see, I'm now inside the folder called NPC PID Udemy course, and you can see that the

63
00:05:06,910 --> 00:05:09,640
‫same files that I have here, the same folders.

64
00:05:09,880 --> 00:05:11,320
‫I also have them here.

65
00:05:11,890 --> 00:05:12,550
‫All of them.

66
00:05:13,180 --> 00:05:18,430
‫Of course, you need to have that specific folder in your current location.

67
00:05:18,460 --> 00:05:23,860
‫Only then you can enter into the folder through this see command.

68
00:05:24,400 --> 00:05:28,030
‫If you don't have that folder in your current location, then you can do it.

69
00:05:28,660 --> 00:05:35,180
‫You can only enter into the folders that you actually have in your current location in your computer.

70
00:05:35,800 --> 00:05:43,210
‫Just like when you're in your desktop, you cannot enter into the folders from your desktop that you

71
00:05:43,220 --> 00:05:45,280
‫do not have on your desktop.

72
00:05:45,880 --> 00:05:50,860
‫The same logic applies to Terminal and Windows Command prompt.

73
00:05:51,340 --> 00:05:59,170
‫If I want to go back, I write C d space two dots enter and then I'm back.

74
00:05:59,710 --> 00:06:05,310
‫And so again, if I want to go one folder back, I can just write code.

75
00:06:05,950 --> 00:06:09,970
‫Two dots and guess where I am at right now.

76
00:06:10,600 --> 00:06:16,060
‫Well, I went to folders back and now I'm again in my home folder.

77
00:06:16,660 --> 00:06:25,750
‫And so if you haven't really worked with Terminal or command prompt before, then do like I do when

78
00:06:25,750 --> 00:06:31,300
‫you write your Python script, then just save it in your desktop.

79
00:06:31,880 --> 00:06:33,010
‫Just save it here.

80
00:06:33,580 --> 00:06:38,830
‫And so when you're in your desktop, then you can see that your saved file is here.

81
00:06:39,400 --> 00:06:46,780
‫And so when you're in your home folder in your terminal or command prompt, then just go into your desktop

82
00:06:46,780 --> 00:06:51,070
‫folder, see the desktop again.

83
00:06:51,160 --> 00:06:55,960
‫See the is in Linux, Windows and Mac OS.

84
00:06:56,590 --> 00:07:04,900
‫Now, when you are in your desktop, then you write either Alice in Linux or did it in Windows Command

85
00:07:04,900 --> 00:07:06,790
‫prompt in Mac OS.

86
00:07:07,450 --> 00:07:08,890
‫It's also Alice.

87
00:07:09,460 --> 00:07:16,510
‫And then you can see the files that you have in your desktop, so you have to Python files here.

88
00:07:17,290 --> 00:07:22,770
‫This one here and this one here, I remember Python files.

89
00:07:22,780 --> 00:07:27,550
‫They need to be saved with this Dot Pi extension.

90
00:07:28,180 --> 00:07:35,530
‫And so when your file is in your desktop and you are inside your desktop, but through your terminal

91
00:07:35,530 --> 00:07:41,950
‫or Windows Command prompt, then in Linux Terminal you run your Python file like this.

92
00:07:42,550 --> 00:07:50,290
‫You write Python three and then the name of the file, which in this case is this one.

93
00:07:50,910 --> 00:07:58,740
‫And then you press enter, if you have an error there, then it will display you this error, for example,

94
00:07:58,740 --> 00:08:02,160
‫I have an error here in Line 15.

95
00:08:02,790 --> 00:08:11,340
‫In that case, you have to enter into your Python file that you had saved in your desktop, which is

96
00:08:11,340 --> 00:08:12,420
‫this one here.

97
00:08:13,050 --> 00:08:19,980
‫And so I have a bunch of stuff that I haven't commented out, so I'm just going to delete it and so

98
00:08:19,980 --> 00:08:21,240
‫I'm going to save the file.

99
00:08:21,870 --> 00:08:29,880
‫This is the file that is saved here in desktop and then I can close the file, and so I'm going to clear

100
00:08:29,880 --> 00:08:30,810
‫my terminal.

101
00:08:31,410 --> 00:08:34,050
‫But you can see that I'm still in my desktop.

102
00:08:34,680 --> 00:08:41,040
‫And so in order to run the file, I write Python three and then calculus seems straight.

103
00:08:41,040 --> 00:08:43,890
‫Line that pie and enter.

104
00:08:44,430 --> 00:08:45,330
‫And there you go.

105
00:08:45,900 --> 00:08:54,090
‫You see, the python file is running if you want to close the file and you just press X. And that's

106
00:08:54,090 --> 00:08:57,690
‫how you run a python file with your terminal.

107
00:08:58,020 --> 00:09:03,390
‫Now, if you have Windows Command prompt, then it's a bit different.

108
00:09:03,960 --> 00:09:10,990
‫Well, in fact, the only difference is that in Windows Command prompt, you don't write this.

109
00:09:11,550 --> 00:09:18,030
‫Once you're in your desktop, you simply write the name of the file.

110
00:09:18,540 --> 00:09:21,480
‫So this would be in Windows Command prompt.

111
00:09:26,830 --> 00:09:31,780
‫This one is in Linux Terminal and in Mac OS terminal.

112
00:09:32,170 --> 00:09:38,740
‫So in Linux Terminal and Mac OS Terminal, you have to write Python three and then space.

113
00:09:39,100 --> 00:09:41,680
‫And the name of the Python file.

114
00:09:42,250 --> 00:09:47,200
‫And don't forget the Dart Pi extension in Windows Terminal.

115
00:09:47,800 --> 00:09:57,160
‫You simply write the name of the Python file with this Dart Pi extension and then you press enter.

116
00:09:57,700 --> 00:09:59,050
‫And that's the only difference.

117
00:09:59,500 --> 00:10:07,660
‫And now if I want to print something, so let's say that I enter into this file again, and let's say

118
00:10:07,660 --> 00:10:11,110
‫that I want to print this distance array.

119
00:10:11,680 --> 00:10:12,530
‫Then I write here.

120
00:10:12,550 --> 00:10:14,560
‫Print distance.

121
00:10:15,190 --> 00:10:16,120
‫I save it.

122
00:10:16,600 --> 00:10:17,800
‫I close it.

123
00:10:18,400 --> 00:10:24,880
‫And then if I run my python file again, then of course, I cannot do it like this because I'm using

124
00:10:24,880 --> 00:10:27,550
‫Linux in Windows Command prompt.

125
00:10:27,730 --> 00:10:31,810
‫You would do it like this, but in Linux, I write it like this.

126
00:10:32,320 --> 00:10:36,700
‫And by the way, Terminal remembers your previous commands.

127
00:10:36,940 --> 00:10:44,080
‫So let's say that you're in your desktop, and if you press the arrow up, then you get your previous

128
00:10:44,080 --> 00:10:44,560
‫command.

129
00:10:45,040 --> 00:10:50,320
‫You press the arrow up again and then you get the command before that.

130
00:10:50,800 --> 00:10:54,040
‫So with this command, I run my Python file.

131
00:10:54,580 --> 00:10:56,350
‫I have my animation here.

132
00:10:56,980 --> 00:11:01,090
‫And as you can see, I have printed my distance array.

133
00:11:01,630 --> 00:11:04,300
‫So if I make it bigger and there you go.

134
00:11:04,660 --> 00:11:06,340
‫This is your distance array.

135
00:11:06,940 --> 00:11:08,410
‫So we right clear.

136
00:11:09,040 --> 00:11:17,830
‫And by the way, there are many commands both in Linux and Mac OS Terminal and Windows Command prompt.

137
00:11:18,340 --> 00:11:24,100
‫You can copy paste files using terminal or command prompt.

138
00:11:24,670 --> 00:11:31,660
‫You can move files from one folder to another folder using terminal or command prompt.

139
00:11:32,200 --> 00:11:38,290
‫You can delete files and install programs using terminal and command prompt.

140
00:11:38,740 --> 00:11:46,660
‫And the thing is that if you get used to it and you do it many times, then you might be faster working

141
00:11:46,660 --> 00:11:54,970
‫in your terminal or command prompt than in the traditional way where you would enter your folder and

142
00:11:54,970 --> 00:11:58,560
‫then either press Control C Control V.

143
00:11:58,570 --> 00:12:05,890
‫If you want to copy, paste it or click the right click and then copy and then paste.

144
00:12:06,370 --> 00:12:11,770
‫And so it's a nice thing to learn to work with terminal or command prompt.

145
00:12:12,250 --> 00:12:18,040
‫And there are many good tutorials on YouTube that I have used to learn about it.

146
00:12:18,520 --> 00:12:25,000
‫And so let's say that I want to enter into my MP Udemy course folder again.

147
00:12:25,600 --> 00:12:26,410
‫So I'm here.

148
00:12:26,860 --> 00:12:30,040
‫Now you already know how to go back right seed.

149
00:12:30,940 --> 00:12:32,800
‫And then space and two dots.

150
00:12:33,430 --> 00:12:37,420
‫However, what happens if I don't put those two dots?

151
00:12:38,080 --> 00:12:43,060
‫If I only put CD, then no matter in which folder you are.

152
00:12:43,660 --> 00:12:47,650
‫You go back into your default home folder.

153
00:12:48,250 --> 00:12:51,760
‫And so that's it on the terminal and the command prompt.

154
00:12:52,210 --> 00:12:53,170
‫Thank you very much.

