1 00:00:00,170 --> 00:00:01,130 Hello everyone. 2 00:00:01,130 --> 00:00:06,440 In this demo, I'm going to show you how to use CP Command and MV Command. 3 00:00:06,680 --> 00:00:09,290 CP Command copies, files and directories. 4 00:00:09,290 --> 00:00:15,110 For example, if I would like to copy this text file if one dot txt to directory one. 5 00:00:15,110 --> 00:00:21,050 So I'm going to type CP, then the name of the text file if one dot txt then the name of the directory. 6 00:00:21,380 --> 00:00:25,430 Now I'm going to check if I do have the text file inside this directory. 7 00:00:25,430 --> 00:00:26,120 Yep. 8 00:00:26,450 --> 00:00:28,850 I do have if one dot txt. 9 00:00:29,390 --> 00:00:32,750 If I would like to copy a directory to another directory. 10 00:00:32,870 --> 00:00:37,340 So cp then I have to add the option dash r. 11 00:00:37,580 --> 00:00:45,980 So this is for the recursive in case if we have subdirectories inside directory two to directory one. 12 00:00:48,920 --> 00:00:49,720 Let's check it out. 13 00:00:49,730 --> 00:00:50,240 Now. 14 00:00:52,580 --> 00:01:01,040 You can see here, as we can see here on the screen, I have the to inside directory one in case if 15 00:01:01,040 --> 00:01:04,099 I would like to copy the content of any text file. 16 00:01:04,099 --> 00:01:08,420 For example, here we have the content here. 17 00:01:08,420 --> 00:01:09,170 One, two, three. 18 00:01:09,200 --> 00:01:11,630 Inside the text file f1 dot txt. 19 00:01:12,350 --> 00:01:13,250 Let's check. 20 00:01:13,290 --> 00:01:15,740 Text file to the f2 dot txt. 21 00:01:15,950 --> 00:01:21,680 We don't have any content there so I'm going to use the cp f1 dot txt. 22 00:01:22,040 --> 00:01:23,260 Then f2. 23 00:01:23,270 --> 00:01:30,440 So what I'm going to do, I'm going to copy the content of text f1 dot txt to f2. 24 00:01:30,650 --> 00:01:31,790 Let's check f2 now. 25 00:01:32,780 --> 00:01:33,710 Perfect. 26 00:01:33,920 --> 00:01:36,530 Now as you can see here in the screen we have one, two, three. 27 00:01:36,890 --> 00:01:48,830 If I would like to copy multiple files, for example F2 and F3 to a directory directory one let's check 28 00:01:48,840 --> 00:01:50,190 directory one right now. 29 00:01:51,660 --> 00:01:58,200 As we can see here, we have text file, the F2, the txt and f3, the txt. 30 00:01:59,400 --> 00:02:00,990 If I would like to copy 31 00:02:03,480 --> 00:02:10,080 more than one directory, for example, I would like to copy the directory three and four to directory 32 00:02:10,080 --> 00:02:10,530 one. 33 00:02:10,650 --> 00:02:18,330 So I'm going to type KB and we don't have to forget the dash order recursive in case if there is any 34 00:02:18,330 --> 00:02:20,040 subdirectories inside this directory. 35 00:02:20,040 --> 00:02:23,790 So then directory three and directory four. 36 00:02:24,030 --> 00:02:28,410 So we're going to copy this to directory three and four to directory one. 37 00:02:29,370 --> 00:02:35,880 Let's check directory one right now, as we can see here, we have directory three and four. 38 00:02:37,200 --> 00:02:43,830 If I would like to find more information about this command KB, we can go to the man page, we can 39 00:02:43,830 --> 00:02:46,440 find more details and also the options. 40 00:02:47,350 --> 00:02:48,340 That we can use. 41 00:02:48,550 --> 00:02:50,290 You use them with the. 42 00:02:50,890 --> 00:02:52,270 With the command. 43 00:02:52,900 --> 00:02:54,280 Okay, Let's go back. 44 00:02:56,110 --> 00:02:59,240 Now let's move on to the next command. 45 00:02:59,260 --> 00:03:00,460 The env command. 46 00:03:00,490 --> 00:03:04,610 If we would like to find more information about this command, we can go to the man page. 47 00:03:04,630 --> 00:03:07,000 So this command, the env command. 48 00:03:07,720 --> 00:03:11,830 Moves are renames names of files and directories. 49 00:03:12,400 --> 00:03:16,570 And we can see here here the options that we can use with the command. 50 00:03:16,810 --> 00:03:19,780 Let's go back and do some examples. 51 00:03:19,780 --> 00:03:23,320 So I would like to move. 52 00:03:24,200 --> 00:03:24,960 If one. 53 00:03:25,040 --> 00:03:28,040 The txt to directory box. 54 00:03:28,040 --> 00:03:29,660 So i'm going to type env. 55 00:03:30,650 --> 00:03:31,100 F one. 56 00:03:31,280 --> 00:03:32,410 TXT two. 57 00:03:32,450 --> 00:03:33,290 Box one. 58 00:03:34,790 --> 00:03:35,510 Go to box. 59 00:03:35,510 --> 00:03:37,400 So then I'm going to hit enter. 60 00:03:37,550 --> 00:03:40,760 I'm going to check right now that directory box. 61 00:03:41,600 --> 00:03:46,070 As we can see here, we have the F1 dot txt. 62 00:03:46,100 --> 00:03:47,750 Let's double check here. 63 00:03:48,210 --> 00:03:56,780 And under the home directory right now we don't have F1 that text anymore in the current directory. 64 00:03:57,410 --> 00:04:03,380 Now if I would like to move multiple files for example, if two, three and four. 65 00:04:03,380 --> 00:04:04,040 Same thing. 66 00:04:04,040 --> 00:04:12,320 So mv f2 then f3 and F4 to directory box. 67 00:04:12,350 --> 00:04:12,920 Okay. 68 00:04:13,280 --> 00:04:17,450 Let's check right now and box. 69 00:04:17,450 --> 00:04:19,370 As we can see here we have. 70 00:04:20,430 --> 00:04:22,530 Text file two, three and four. 71 00:04:22,960 --> 00:04:25,230 Let's check right now the current directory. 72 00:04:25,620 --> 00:04:28,710 As we can see here, we don't have all these text files. 73 00:04:28,800 --> 00:04:38,760 If I would like to move a directory so I'm going to type env, then I'm going to move directory one 74 00:04:39,720 --> 00:04:41,160 to box. 75 00:04:41,160 --> 00:04:44,100 So I'm going to type directory one. 76 00:04:44,430 --> 00:04:45,750 Then box. 77 00:04:46,260 --> 00:04:47,850 LS dash L. 78 00:04:47,890 --> 00:04:50,130 Then I'm going to go to this directory. 79 00:04:50,130 --> 00:04:57,300 As we can see here we have directory one and right now here in the current directory we don't have directory 80 00:04:57,300 --> 00:05:05,040 one right now here in this current directory, if I would like to move more than one directory. 81 00:05:05,730 --> 00:05:08,100 So what I'm going to do, I'm going to do the same thing. 82 00:05:08,130 --> 00:05:12,690 Envy then, for example, directory to. 83 00:05:13,970 --> 00:05:15,740 Then directory three. 84 00:05:16,610 --> 00:05:20,750 Then directory 422 box. 85 00:05:20,750 --> 00:05:25,040 So let's check right now the directory box. 86 00:05:25,190 --> 00:05:29,360 As we can see here, we have directory two, three and four. 87 00:05:30,380 --> 00:05:35,120 Let's check right now the current directory so we don't have directory two and three and four. 88 00:05:35,390 --> 00:05:40,070 If I would like to rename for example the text file here. 89 00:05:40,070 --> 00:05:43,100 So I'm going to use the same command mv. 90 00:05:44,080 --> 00:05:50,800 And the text text then text.txt. 91 00:05:50,890 --> 00:05:55,510 Then I'm going to call this one file dot txt. 92 00:05:56,440 --> 00:05:57,280 Let's check right now. 93 00:05:57,340 --> 00:06:01,090 As you can see here, so we change the name to file dot txt. 94 00:06:01,420 --> 00:06:06,400 If I would like to change the name of any directory will be the same thing. 95 00:06:06,400 --> 00:06:07,390 For example box. 96 00:06:07,390 --> 00:06:15,040 I'm going to use env box to call this one directory. 97 00:06:15,580 --> 00:06:16,180 Perfect. 98 00:06:16,630 --> 00:06:17,500 Dash l. 99 00:06:18,250 --> 00:06:24,610 As we can see here, we change the name of the directory from box to directory. 100 00:06:24,670 --> 00:06:26,500 That's it for this session. 101 00:06:26,530 --> 00:06:28,510 Thank you and see you in the next lesson.