1
00:00:00,330 --> 00:00:05,490
All right we have two more important command line commands to learn before we can move on to node and

2
00:00:05,490 --> 00:00:07,770
express and actually writing code.

3
00:00:08,190 --> 00:00:16,340
So those two commands are our AM and the other one is r.m dash Aref.

4
00:00:16,620 --> 00:00:23,580
Technically this is actually just one command r.m and this is something called a flag which is a way

5
00:00:23,580 --> 00:00:25,890
of changing what the command does.

6
00:00:26,370 --> 00:00:28,260
Let's begin with r.m.

7
00:00:28,260 --> 00:00:32,000
We use our m to delete a specific file.

8
00:00:32,340 --> 00:00:35,640
So in this case let's go to the fav colors directory.

9
00:00:35,760 --> 00:00:40,350
And as I mentioned before blue and green are not actually my favorite colors so let's get them out of

10
00:00:40,350 --> 00:00:42,390
there let's just delete them entirely.

11
00:00:42,630 --> 00:00:51,660
So we need to CD in two colors slash fav colors just like that and we can see blue green and purple

12
00:00:52,320 --> 00:00:54,750
to remove blue dot text.

13
00:00:54,750 --> 00:00:57,820
I need to first type on them and then the name of the file.

14
00:00:57,870 --> 00:01:04,910
So r.m Blue Dot T or use autocomplete member of that tab.

15
00:01:05,430 --> 00:01:09,190
And if I type LS It's now gone.

16
00:01:09,630 --> 00:01:14,060
I don't know if you noticed but it didn't actually delete from the file tree yet.

17
00:01:14,370 --> 00:01:19,980
And that's just a matter of it lagging a little bit behind because remember when we actually delete

18
00:01:19,980 --> 00:01:22,770
this file it's on a computer somewhere else.

19
00:01:22,890 --> 00:01:27,140
So on one of cloud nines computers that they've designated for me to use here.

20
00:01:27,360 --> 00:01:32,220
So when I delete something yes they send the command from my browser to their computer.

21
00:01:32,220 --> 00:01:37,620
It then deletes the folder or the file and then once it's been deleted it then sends something back

22
00:01:37,920 --> 00:01:43,640
to my file tree to tell it to remove blue dot to 60 from the display.

23
00:01:43,680 --> 00:01:48,300
So sometimes it likes a little bit which is another reason that it's good to just use the command line

24
00:01:48,310 --> 00:01:48,770
.

25
00:01:49,230 --> 00:01:51,670
Let's also remove the green tea XTi.

26
00:01:51,690 --> 00:01:54,480
So r.m green tea XTi.

27
00:01:54,930 --> 00:02:00,030
And now we're left with just Purple about THC which as I mentioned is my favorite color.

28
00:02:00,510 --> 00:02:03,220
So that's how we can remove individual files.

29
00:02:03,540 --> 00:02:09,180
And then the other command is r.m dash R.F. which allows us to remove entire directories.

30
00:02:09,540 --> 00:02:18,660
So I'm going to back out and one more time and I'm going to delete the entire colour's directory and

31
00:02:18,720 --> 00:02:25,560
that means getting rid of orange red and yellow that he XTi as well as fav colors and my beloved purple

32
00:02:25,560 --> 00:02:30,640
that THC going to get rid of all of them by using Ahram dash Aref

33
00:02:33,350 --> 00:02:36,970
the dash R.F. stands for something that you might not expect.

34
00:02:36,990 --> 00:02:44,250
It stands for recursive force which basically means that when we say delete colors it's going to delete

35
00:02:44,310 --> 00:02:47,730
all of the child directories that colour's contains.

36
00:02:47,730 --> 00:02:52,770
So not only the files here but it will delete fav colors and all the files inside of that.

37
00:02:52,770 --> 00:02:55,640
And that could go nested as many levels as we want.

38
00:02:55,680 --> 00:02:59,230
It's going to force delete everything inside of that directory.

39
00:02:59,280 --> 00:03:08,310
Technically Ahram and r.m dash R.F. are the same command line command and dash Areff is a modifier or

40
00:03:08,310 --> 00:03:11,480
what's called a flag for the r.m command.

41
00:03:11,520 --> 00:03:13,300
So it's still the r.m command.

42
00:03:13,440 --> 00:03:16,700
But dash R.F. will have it do something slightly different.

43
00:03:16,860 --> 00:03:21,070
And then we need to provide an argument which is the name of the directory to delete.

44
00:03:21,240 --> 00:03:23,750
And in this case it's colors.

45
00:03:23,910 --> 00:03:28,940
So r.m dash R.F. space colors and I hit enter.

46
00:03:29,370 --> 00:03:32,870
And you can see my entire colors directory just disappeared.

47
00:03:33,190 --> 00:03:36,830
If I type LS over here there is no colors director anymore.

48
00:03:36,900 --> 00:03:44,280
If I try and C.D into colors it tells me no such file or directory and it's all gone including my fav

49
00:03:44,280 --> 00:03:48,090
colors directory and my purple that TXI the file as well.

50
00:03:48,150 --> 00:03:54,810
To summarize r.m will delete an individual file and Ahram dash R.F. will delete an entire directory

51
00:03:54,820 --> 00:03:55,120
.

52
00:03:55,410 --> 00:04:02,190
One interesting note about r.m dash Areff is that if you're not careful and you use it in the root directory

53
00:04:02,220 --> 00:04:07,890
of your entire computer you could actually wipe everything from your machine.

54
00:04:07,890 --> 00:04:10,500
And I've never actually seen that or heard that happen.

55
00:04:10,500 --> 00:04:15,630
It's almost like an urban legend I guess at this point but it is something that is technically possible

56
00:04:15,630 --> 00:04:15,750
.

57
00:04:15,840 --> 00:04:23,220
If you did r.m dash RF slash which almost scares me to even type that even though I have nothing of

58
00:04:23,220 --> 00:04:25,280
value on this workspace yet.

59
00:04:25,560 --> 00:04:29,940
If I hit enter that could delete every single thing in this workspace.

60
00:04:29,940 --> 00:04:32,560
It's an interesting tidbit but it's also worth knowing about
