1
00:00:07,570 --> 00:00:13,900
What is everybody this is Jason with there's soapstar com and in this video we are going to learn how

2
00:00:13,900 --> 00:00:19,470
to move files copy files and rename files.

3
00:00:19,480 --> 00:00:22,500
All right so let's dive in and get started.

4
00:00:22,510 --> 00:00:24,250
So we've been working in our terminal.

5
00:00:24,250 --> 00:00:28,860
We've got a few commands we've done in here so let's go ahead and clear this out.

6
00:00:28,870 --> 00:00:30,270
So again I'm just going to write.

7
00:00:30,280 --> 00:00:35,200
Clear and press ENTER give us more space to work with.

8
00:00:35,200 --> 00:00:40,380
All right so what we're going to learn first is how to move files.

9
00:00:40,420 --> 00:00:46,630
So in the Finder what I'm going to do is I'm going to go back a directory I'm going to go back one more

10
00:00:47,440 --> 00:00:53,470
and actually let's go ahead and stay in the directory fun that we've done here.

11
00:00:53,650 --> 00:01:01,480
So from the from the root level of our directory fun let's go ahead and create a folder so you can see

12
00:01:01,480 --> 00:01:03,790
here in the terminal that I'm in services.

13
00:01:03,950 --> 00:01:04,290
All right.

14
00:01:04,300 --> 00:01:12,000
So I need to go back to level and now I'm in the root level of this project that we're working in right

15
00:01:12,010 --> 00:01:12,880
listed all out.

16
00:01:12,880 --> 00:01:14,540
Everything looks good.

17
00:01:14,800 --> 00:01:20,490
So let's create a folder and I'm going to call this.

18
00:01:20,660 --> 00:01:26,470
So let's just make a directory and we'll call it just say that we want to store over javascript files

19
00:01:26,470 --> 00:01:26,940
in here.

20
00:01:27,130 --> 00:01:28,890
So I've just made this directory.

21
00:01:29,080 --> 00:01:35,680
And you can see over here in the Finder that it's appeared and says I'm building this project I want

22
00:01:35,680 --> 00:01:41,920
to organize a project a little bit better and I want to keep all my javascript files in this one directory

23
00:01:42,280 --> 00:01:46,000
so we can do that through the terminal by moving the file.

24
00:01:46,000 --> 00:01:49,920
And to do that we're going to type in the command and we move.

25
00:01:50,130 --> 00:01:50,800
All right.

26
00:01:50,800 --> 00:01:54,520
And then we need to grab the name of the file that we want to move.

27
00:01:54,550 --> 00:02:00,430
So we're going to type in main J.S. and then now we've got to give it a location of where we want it

28
00:02:00,430 --> 00:02:01,060
to go.

29
00:02:01,240 --> 00:02:06,880
If I was to go ahead and press enter here the terminals are going to throw me in there and it says hey

30
00:02:06,880 --> 00:02:10,430
dude you didn't give me a directory where you want me to move this.

31
00:02:10,630 --> 00:02:12,610
So please specify something for me.

32
00:02:12,760 --> 00:02:13,710
So let's do it again.

33
00:02:13,720 --> 00:02:16,450
Let's take an beam main door.

34
00:02:16,470 --> 00:02:17,450
Yes.

35
00:02:17,650 --> 00:02:21,030
And where we want to move this is into our genius folder.

36
00:02:21,040 --> 00:02:27,880
All right go ahead and press enter and you can see over here in the Finder that the file has disappeared

37
00:02:27,880 --> 00:02:28,420
it's gone.

38
00:02:28,420 --> 00:02:29,320
Where did it go.

39
00:02:29,470 --> 00:02:30,190
Well done.

40
00:02:30,520 --> 00:02:33,250
We moved it into the transcript file So pretty cool.

41
00:02:33,250 --> 00:02:34,380
There it is.

42
00:02:34,390 --> 00:02:34,830
All right.

43
00:02:34,840 --> 00:02:39,490
And then we can move files around anywhere we want.

44
00:02:39,520 --> 00:02:46,060
And what I want to show you now is how to move a file back to where it was and we can do this.

45
00:02:46,150 --> 00:02:48,140
This is a little bit tricky.

46
00:02:48,160 --> 00:02:55,500
Make sure that we're in the James file so we've got to change her directory so CD J us Leslie out.

47
00:02:55,500 --> 00:02:58,770
We can see our file in here and we're going to do.

48
00:02:58,790 --> 00:03:07,780
Nvm the main dot J S file and what we have to do is we need to go back a directory so remember how we

49
00:03:07,780 --> 00:03:10,790
use the CD command space dot dot.

50
00:03:11,170 --> 00:03:15,820
Well we're going to do the same thing the DOT DOT allows us to go back a level.

51
00:03:15,820 --> 00:03:18,820
So I'm going to hit dot dot for Slash.

52
00:03:18,820 --> 00:03:27,140
This is going to give me the path where I want to go and where we want to go is directory fun.

53
00:03:27,280 --> 00:03:32,930
So in the terminal Let's go ahead and type that out directory fun.

54
00:03:33,340 --> 00:03:36,240
So we're going to take this file and we're going to move it back.

55
00:03:36,250 --> 00:03:36,910
All right.

56
00:03:36,910 --> 00:03:40,530
It looks like we have something really goofy happen here.

57
00:03:40,690 --> 00:03:51,150
So we didn't even move our main Jap's file into our directory fun directory.

58
00:03:51,200 --> 00:03:58,060
What it actually did is it created a directory fun file without an extension.

59
00:03:58,060 --> 00:04:05,580
And the reason it did this is because you can actually use this same command M.V. to rename a file.

60
00:04:05,590 --> 00:04:13,390
So technically what I said here is I said hey in the javascript directory and take the main js file

61
00:04:13,700 --> 00:04:17,650
move it back a directory and rename it to directory fun.

62
00:04:17,800 --> 00:04:19,240
So that's what happened here.

63
00:04:19,240 --> 00:04:27,060
So let me show you how to actually properly do this so we're in our javascript our Jasc directory still.

64
00:04:27,070 --> 00:04:28,700
So let me come back to here.

65
00:04:28,960 --> 00:04:32,390
I'm going to create the file again.

66
00:04:32,880 --> 00:04:34,000
Yes.

67
00:04:34,090 --> 00:04:35,190
All right so now it's here.

68
00:04:35,200 --> 00:04:36,730
So let's try this again.

69
00:04:37,030 --> 00:04:41,390
We're going to do nvm main dot J Yes.

70
00:04:41,500 --> 00:04:45,100
And we're simply going to do that dot dot forward slash.

71
00:04:45,100 --> 00:04:51,300
We're just going to leave it at that because that way it puts it into the Directory fun here.

72
00:04:51,730 --> 00:04:59,120
So now when we come back over to our directory now you'll see the file is here.

73
00:04:59,130 --> 00:05:07,580
Now let me explain a little bit further why it created this file here in the JSM going to create another

74
00:05:07,580 --> 00:05:12,210
file we'll just call this awesome dot Jess.

75
00:05:12,340 --> 00:05:13,340
All right.

76
00:05:13,520 --> 00:05:21,410
What I was saying and this command is well what I was trying to say is move this file back into a directory

77
00:05:21,410 --> 00:05:23,810
which technically didn't exist.

78
00:05:23,900 --> 00:05:29,870
So a directory that does exist is this services in our directory bun.

79
00:05:29,930 --> 00:05:43,190
So what I could do with this is I could say move the awesome J us back a directory into the services

80
00:05:43,400 --> 00:05:44,350
directory.

81
00:05:44,480 --> 00:05:49,970
And if I hit enter you can see that the file isn't in here anymore.

82
00:05:50,180 --> 00:05:55,940
If we go into our services you can see that the awesome jazz file has now been moved.

83
00:05:55,940 --> 00:05:57,680
So pretty cool stuff here.

84
00:05:57,710 --> 00:06:01,160
So we've covered how to move a file.

85
00:06:01,190 --> 00:06:03,630
Let me show you how to copy a file.

86
00:06:03,740 --> 00:06:06,320
So let's find a file that we want to copy here.

87
00:06:06,710 --> 00:06:09,540
Let's say that this.

88
00:06:09,740 --> 00:06:11,660
Let's see we have here.

89
00:06:11,660 --> 00:06:13,750
Let's create another folder or another file.

90
00:06:13,760 --> 00:06:21,500
So let's go back a level where in our directory fun we're going to create a file called Master dodgiest

91
00:06:22,100 --> 00:06:29,450
and say this is a master template of some specific crazy function in our code project whatever.

92
00:06:29,550 --> 00:06:30,310
Right.

93
00:06:30,350 --> 00:06:36,140
So what we want to do is say we want to use this template in other parts of our project.

94
00:06:36,170 --> 00:06:38,570
OK like another component per se.

95
00:06:38,930 --> 00:06:44,600
And we're going to move it over into our services so or copy it into our services because we want it

96
00:06:44,600 --> 00:06:48,740
to also stay in this root level directory fun.

97
00:06:48,800 --> 00:06:53,510
So we're going to use the command C.P. to copying.

98
00:06:53,780 --> 00:07:01,850
And then we're going to grab the name of the file master dot J.S. and then we're going to specify the

99
00:07:01,850 --> 00:07:07,850
directory we wanted to go into which will just in this example call it services and we're going to hit

100
00:07:07,880 --> 00:07:08,860
enter.

101
00:07:08,960 --> 00:07:16,190
Now if we come into our services you will see that we have the master js file and this is this is cool

102
00:07:16,190 --> 00:07:24,410
because when you're working with different frameworks like angular to for example you're working with

103
00:07:24,410 --> 00:07:31,040
a lot of components you might have a typescript file that might be some master like template for a component

104
00:07:31,040 --> 00:07:37,610
per se and you could go ahead and use this copy command to copy the entire file into that component

105
00:07:37,910 --> 00:07:40,400
to set up like us a skeleton for you.

106
00:07:40,400 --> 00:07:40,730
All right.

107
00:07:40,730 --> 00:07:42,810
So pretty easy stuff.

108
00:07:42,830 --> 00:07:49,200
Now the last thing that I want to cover is how to rename a file.

109
00:07:49,430 --> 00:07:52,400
Let's see say this awesome J.S. file here.

110
00:07:52,640 --> 00:07:57,550
Very poorly named it doesn't really specify anything that we're trying to do.

111
00:07:57,710 --> 00:08:00,390
So let's go ahead and change the name of that.

112
00:08:00,470 --> 00:08:04,480
So paying attention in our terminal we're in the directory fun.

113
00:08:04,610 --> 00:08:06,680
So we need to get into our services.

114
00:08:07,310 --> 00:08:13,540
So we're going to change the directory here and to rename a file We're going to use the same.

115
00:08:13,580 --> 00:08:16,380
And the command that we use for move.

116
00:08:16,730 --> 00:08:25,100
And then we're going to say we want to take the file awesome J.S. and let's rename it to cats just because

117
00:08:25,100 --> 00:08:27,750
that makes way more sense.

118
00:08:27,760 --> 00:08:29,130
All right.

119
00:08:29,150 --> 00:08:32,150
And you can see the file has change right before our eyes.

120
00:08:32,150 --> 00:08:33,710
So very powerful stuff.

121
00:08:33,710 --> 00:08:36,350
Again this is stuff that you're going to be using all the time.

122
00:08:36,380 --> 00:08:43,340
You've got to know how to move files around copy things around and also rename things in case you need

123
00:08:43,340 --> 00:08:45,940
a better naming convention for some of the files you're working with.

124
00:08:45,940 --> 00:08:48,780
So that is a wrap for this video.

125
00:08:48,920 --> 00:08:49,820
Let's move on.

