1
00:00:00,300 --> 00:00:05,190
It's time again for another quick exercise this time you'll get some practice with the basic command

2
00:00:05,190 --> 00:00:11,620
line commands like touch and CD and Ls and the other ones that we've talked about in the last few videos

3
00:00:11,630 --> 00:00:11,950
.

4
00:00:12,420 --> 00:00:17,040
As always I'll do a quick intro to the assignment and then you should post the video and do this one

5
00:00:17,040 --> 00:00:17,790
on your own.

6
00:00:18,120 --> 00:00:21,250
So here's the assignment using only the command line.

7
00:00:21,360 --> 00:00:28,710
So no right clicking no file new file only the command line make a new folder called animals and then

8
00:00:28,710 --> 00:00:32,310
inside of the animals folder add two more directories.

9
00:00:32,520 --> 00:00:35,450
Awesome animals and sketchy animals.

10
00:00:35,730 --> 00:00:41,540
And then inside of the awesome animals directory I want you to add three different files Kappy Barakat

11
00:00:41,650 --> 00:00:46,890
J.S. arctic fox does Tim owl and tree frog TXI.

12
00:00:47,370 --> 00:00:54,090
And then instead of the sketchy animals folder add to other files brown recluse that all very sketchy

13
00:00:54,090 --> 00:00:56,030
spider and bullet and Dot.

14
00:00:56,060 --> 00:00:57,080
Yes.

15
00:00:57,300 --> 00:01:04,740
Next inside of the sketchy animals directory create a new directory called snakes inside of that snakes

16
00:01:04,740 --> 00:01:10,880
directory create two files COBRA to see assess and articulate it Python.

17
00:01:12,150 --> 00:01:15,450
Then you decide that bullet ants are actually not sketchy.

18
00:01:15,540 --> 00:01:18,310
They're totally misunderstood and you want to clear their name.

19
00:01:18,510 --> 00:01:25,950
So you're going to remove the bullet and Dot G-S file and then the very last thing is that unfortunately

20
00:01:25,950 --> 00:01:31,200
all animal life goes extinct and you have to delete the entire animal's directory and everything inside

21
00:01:31,200 --> 00:01:32,880
of it.

22
00:01:32,910 --> 00:01:36,270
So just to reiterate this is all with only the command line.

23
00:01:36,480 --> 00:01:40,400
So you shouldn't use your mouse at all just typing commands right here.

24
00:01:40,530 --> 00:01:42,530
You should be able to do all of this.

25
00:01:42,870 --> 00:01:47,790
And then there's a bonus at the end which is to see if you can do the whole thing without ever using

26
00:01:47,790 --> 00:01:49,530
the cd command.

27
00:01:49,530 --> 00:01:51,390
All right so it's a video.

28
00:01:51,390 --> 00:01:53,460
Definitely give this one a shot in your own.

29
00:01:53,520 --> 00:01:56,500
It's really really important that you get comfortable with the command line.

30
00:01:56,520 --> 00:01:57,830
As soon as possible.

31
00:01:58,080 --> 00:02:03,610
And then when you're ready unposed video and I'll be here with a quick solution already.

32
00:02:03,660 --> 00:02:06,270
Let's go ahead and go over the solution.

33
00:02:06,270 --> 00:02:12,600
So the first thing is that we need to make a new folder named animals and I didn't specify where you

34
00:02:12,600 --> 00:02:15,090
needed to do this so it doesn't actually matter.

35
00:02:15,120 --> 00:02:21,210
I'm going to do it right where I am inside of Intro to command line to make a new folder named animals

36
00:02:21,210 --> 00:02:21,260
.

37
00:02:21,270 --> 00:02:26,730
It's M-K KTAR animals and then Rigaud type.

38
00:02:26,730 --> 00:02:30,110
LS You can see animals instead of animals.

39
00:02:30,180 --> 00:02:34,820
Add to directory's awesome animals and sketchy animals.

40
00:02:35,650 --> 00:02:38,090
So CD instead of animals.

41
00:02:39,000 --> 00:02:40,380
And then we'll add a directory.

42
00:02:40,410 --> 00:02:49,200
So M-K DA are awesome animals and Cadia are sketchy animals.

43
00:02:49,770 --> 00:02:56,010
For the record we could have combined those onto one line and just said M-K DA are awesome animals space

44
00:02:56,100 --> 00:03:00,840
sketchy animals and that would make two for us instead of awesome animals.

45
00:03:00,870 --> 00:03:02,110
Add three files.

46
00:03:02,220 --> 00:03:05,970
Let's go inside of Manimal so CD awesome.

47
00:03:05,970 --> 00:03:06,740
There we go.

48
00:03:07,050 --> 00:03:12,220
And butts touch Kappy Bara dot.

49
00:03:12,360 --> 00:03:25,580
I always wanted to touch one of those touch and arctic fox that HMO and touch tree frog Dot T S T.

50
00:03:26,310 --> 00:03:32,070
And again just like with make directory we could have combined those into one line by saying touch carefully

51
00:03:32,070 --> 00:03:38,290
Barcott J.S. space arctic fox space tree frog and that would create three files.

52
00:03:38,310 --> 00:03:39,390
Let's just double check.

53
00:03:39,400 --> 00:03:40,570
Type ls.

54
00:03:40,620 --> 00:03:42,680
There are three files recreated.

55
00:03:42,990 --> 00:03:49,340
Now we need to go inside of the sketchy animals and add brown recluse that aged him l and bullet anti-Jesus

56
00:03:49,580 --> 00:03:50,580
so well back out.

57
00:03:50,680 --> 00:03:52,560
The dot dot.

58
00:03:52,710 --> 00:03:59,790
Now we're inside of animals and we're gonna go instead of sketchy animals and it's totally empty so

59
00:03:59,790 --> 00:04:09,110
we're going to touch two files brown recluse that HMO and bullet ant.

60
00:04:09,210 --> 00:04:13,410
Yes and I'm going to do them this time on the same line.

61
00:04:13,620 --> 00:04:21,120
So just touch brown recluse that H.T. male space pull it and touch us if we type LS he can see both

62
00:04:21,120 --> 00:04:23,400
of them were created for us.

63
00:04:23,400 --> 00:04:31,200
Now the next part is inside of sketchy animals create a snake's directory so that M KTAR make directory

64
00:04:31,830 --> 00:04:32,400
snakes

65
00:04:35,430 --> 00:04:39,230
and then instead of the snakes directory create the following files.

66
00:04:39,240 --> 00:04:43,760
Cobra does the SS and reticulated python p y.

67
00:04:43,870 --> 00:04:50,730
So we'll go into the snake's directory just like that and will make co-productions us so touch.

68
00:04:50,730 --> 00:04:52,840
Cobra does S. S. S..

69
00:04:52,920 --> 00:05:04,740
Hope I never have to touch COBRA and reticulated python P Y which is python Yes it's a very funny joke

70
00:05:05,430 --> 00:05:08,940
and we'll hit Enter now we type.

71
00:05:09,120 --> 00:05:09,630
There we go.

72
00:05:09,620 --> 00:05:11,280
We have our two files created.

73
00:05:11,270 --> 00:05:14,670
We touched both COBRA and a python.

74
00:05:14,670 --> 00:05:18,860
Then we have a change of heart and decide that bullet ants are no longer sketchy.

75
00:05:18,930 --> 00:05:20,950
So we want to delete that file.

76
00:05:21,020 --> 00:05:25,020
So I'm going to back out of the snake's directory.

77
00:05:25,110 --> 00:05:31,190
Now I'm inside of the sketchy animal directory and I'm going to delete brown recluse that aged him l

78
00:05:31,310 --> 00:05:37,580
with R M R M and then use tab completion brown recluse said time I'll hit enter.

79
00:05:37,920 --> 00:05:44,760
It's now gone then will CD back and then unfortunately all animal life has gone extinct.

80
00:05:44,940 --> 00:05:48,630
And now we need to delete the entire animal directory.

81
00:05:48,620 --> 00:05:52,810
So I'm going to back out so that now I see the animals directory.

82
00:05:52,810 --> 00:05:53,460
I'm inside of.

83
00:05:53,450 --> 00:06:04,350
INTRO TO command line and to delete that I need to use r.m dash R.F. animals and there we go type ls

84
00:06:04,700 --> 00:06:07,750
and animals is completely gone.

85
00:06:07,800 --> 00:06:13,710
Now let's quickly discuss the bonus which was to do all of the commands without ever changing directories

86
00:06:13,880 --> 00:06:16,140
so never using the CD command.

87
00:06:16,190 --> 00:06:21,200
It's actually not difficult to do it the same exact commands but we have to reference different paths

88
00:06:21,230 --> 00:06:21,450
.

89
00:06:21,690 --> 00:06:24,930
So let me show you what I mean to make a new directory called animals.

90
00:06:24,930 --> 00:06:32,000
That's exactly the same to make directory animals but rather than seeing into animals to make awesome

91
00:06:32,000 --> 00:06:40,950
animals and sketchy animals we can do a make directory animals slash awesome animals just like that

92
00:06:41,570 --> 00:06:50,490
and make directory animals slash sketchy animals.

93
00:06:50,490 --> 00:06:55,000
Now if I just type LS here all we see is animals but I could type.

94
00:06:55,000 --> 00:06:56,970
LS animals.

95
00:06:57,000 --> 00:07:03,660
And now we see awesome animals and sketchy animals so inside of awesome animals we're going to add these

96
00:07:03,650 --> 00:07:05,560
three phials coffee bar.

97
00:07:05,670 --> 00:07:07,360
Arctic fox and tree frog.

98
00:07:07,640 --> 00:07:17,010
So without leaving this directory we're going to do a touch animals slash awesome animals.

99
00:07:17,250 --> 00:07:24,960
We can use tab completion slash Caffre Bara dot J us and then do the same thing animals slash awesome

100
00:07:24,960 --> 00:07:26,220
animals.

101
00:07:26,510 --> 00:07:29,440
Except this time Arctic fox.

102
00:07:29,890 --> 00:07:31,030
H m l.

103
00:07:31,310 --> 00:07:34,140
And then one more time and I'm hitting the up arrow here.

104
00:07:34,130 --> 00:07:39,360
Just like in the javascript Council we can hit the up arrow to retrieve the most recent commands and

105
00:07:39,360 --> 00:07:43,230
we can keep hitting it to cycle through everything in our history.

106
00:07:43,390 --> 00:07:51,270
So using that just to save some time and we're going to create a tree frog that TXI me again if I just

107
00:07:51,260 --> 00:07:52,260
type ls.

108
00:07:52,400 --> 00:07:53,580
All I see is animals.

109
00:07:53,610 --> 00:07:55,590
So if I do ls animals

110
00:07:58,130 --> 00:08:03,180
animals slash awesome animals I now have those three files.

111
00:08:03,180 --> 00:08:07,800
Next up is instead of sketchy animals and brown recluse and bullet ants.

112
00:08:07,940 --> 00:08:19,440
So will do touch animals slash sketchy animals slash brown recluse dot T.M. and the same thing except

113
00:08:20,220 --> 00:08:24,050
for a bullet ant that genius.

114
00:08:25,010 --> 00:08:32,940
And then to verify that we can do an ls animals slash sketchy animals and we see both the files there

115
00:08:33,170 --> 00:08:36,120
without ever leaving our insured to command line directory.

116
00:08:36,140 --> 00:08:38,080
We're still right here.

117
00:08:38,630 --> 00:08:38,950
All right.

118
00:08:38,970 --> 00:08:40,660
Now onto my least favorite part.

119
00:08:40,800 --> 00:08:42,970
We have to create the snake's directory.

120
00:08:42,970 --> 00:08:50,540
There so sketchy they need their own directory here so we're going to make directory animals slash sketchy

121
00:08:50,550 --> 00:08:59,300
animals slash snakes and that will make us a directory and you can see that here instead of sketchy

122
00:08:59,310 --> 00:09:02,950
animals we now have a sneaky directory.

123
00:09:02,970 --> 00:09:09,090
Now instead of that snake's directory we need to make Cobra does s.c.s and reticulated python Python

124
00:09:09,100 --> 00:09:09,330
.

125
00:09:09,600 --> 00:09:20,240
So we're going to do a touch animals slash Sketchley animals slash snakes slash Cobra C Ss and the same

126
00:09:20,250 --> 00:09:28,820
thing except reticulated python I don't think it could have picked a longer animal name there.

127
00:09:28,830 --> 00:09:37,170
Now we can verify that with an us animals sketchy animals snakes and we get those two files.

128
00:09:37,230 --> 00:09:41,490
Next up we're going to delete the bullet and Jacque's file.

129
00:09:41,490 --> 00:09:44,960
So we still use r.m but we have do the full path.

130
00:09:45,060 --> 00:09:52,000
So animals slash sketchy animals slash bullet and thought genius.

131
00:09:52,430 --> 00:10:02,480
Now if I do ls animals slash Sketchley animals you can see that it's gone now.

132
00:10:02,510 --> 00:10:05,950
The easy part is to delete the entire animal's directory.

133
00:10:06,240 --> 00:10:07,860
You don't have to do anything fancy.

134
00:10:07,860 --> 00:10:17,160
All we need to do is r.m dash R.F. animals and we've now wiped out all animal life on this planet.

135
00:10:17,370 --> 00:10:18,830
You monster.

136
00:10:18,990 --> 00:10:20,820
All right so that's it for the exercise.

137
00:10:21,060 --> 00:10:26,480
Hopefully that was some good practice for you if at any point you struggled to recall or to use any

138
00:10:26,490 --> 00:10:28,350
of the commands that we talked about.

139
00:10:28,350 --> 00:10:30,220
I highly highly recommend that case.

140
00:10:30,240 --> 00:10:34,760
I cannot recommend it enough that you take some time away from this video.

141
00:10:34,760 --> 00:10:37,020
Don't move on just yet and practice.

142
00:10:37,010 --> 00:10:43,020
So whether that means watching the video again doing this exercise again making up your own exercise

143
00:10:43,320 --> 00:10:45,070
but those basic commands.

144
00:10:45,120 --> 00:10:52,610
Those six that we talked about so that's ls and CD touch and make directory an arm in arm dash RF are

145
00:10:52,620 --> 00:10:55,900
really important for basically everything we're going to do from here on out.
