1 00:00:00,480 --> 00:00:07,970 Hello in this venue we will learn how to rename files and how to physically move files. 2 00:00:07,980 --> 00:00:13,660 So right now I'll go to my desktop and I'll make a list just. 3 00:00:13,860 --> 00:00:19,920 This will show me all the files including hidden files and of course I have here nothing except my two 4 00:00:19,920 --> 00:00:27,030 special directories which are the current directory and the parent directory as you know they are present 5 00:00:27,060 --> 00:00:30,870 underneath any directory in our file system. 6 00:00:30,930 --> 00:00:34,300 So let's make a new file I'll call it one too. 7 00:00:34,920 --> 00:00:39,610 And inside of this file I will say I like aboon too. 8 00:00:39,660 --> 00:00:42,190 And of course I love Ubuntu. 9 00:00:42,750 --> 00:00:47,860 So right now what if you want to rename Ubuntu into another name. 10 00:00:47,880 --> 00:00:52,050 So this file you're going to I want to rename it for example to Fedora. 11 00:00:52,110 --> 00:00:53,310 This is very simple. 12 00:00:53,310 --> 00:01:01,250 All you need to do is just say envy your all the file name and then you specify your new filename. 13 00:01:01,260 --> 00:01:06,270 So in this case I want to rename one to two fedora. 14 00:01:06,780 --> 00:01:08,360 And here you go. 15 00:01:08,550 --> 00:01:10,940 Now the file is renamed to Fedora. 16 00:01:10,950 --> 00:01:16,420 And if you open up Fedora you will have the same content which is I like Ubuntu. 17 00:01:16,950 --> 00:01:24,390 So MVR stands for move and you can use it both to rename files and you can also use it to physically 18 00:01:24,390 --> 00:01:25,030 move files. 19 00:01:25,050 --> 00:01:27,140 But right now we focus on renaming. 20 00:01:27,350 --> 00:01:28,280 OK. 21 00:01:29,220 --> 00:01:30,420 And do you remember. 22 00:01:30,440 --> 00:01:34,560 I actually know what I want to rename it back to open too. 23 00:01:34,560 --> 00:01:41,110 So I would say move Fedora aboon to M.V. perfect. 24 00:01:41,170 --> 00:01:50,500 So we are we mentioned before that any hidden file begins with a dot and if any hidden file name begins 25 00:01:50,500 --> 00:01:51,250 with one dot. 26 00:01:51,250 --> 00:01:51,770 Right. 27 00:01:51,820 --> 00:01:59,020 So if I want to make up into a hidden file all I need to do is say M.V. Kubuntu and then I will have 28 00:01:59,020 --> 00:02:01,280 to specify my new name. 29 00:02:01,480 --> 00:02:05,410 But I have to include one dot in the beginning to make it hidden. 30 00:02:05,620 --> 00:02:12,430 So my new file name will be open to the one before and but this one will be hidden because I have one 31 00:02:12,430 --> 00:02:15,290 dot in my name beginning with one dot. 32 00:02:15,310 --> 00:02:23,510 So if I could just this will make it hidden it will not delete it and if I want to confirm that al-Sayed 33 00:02:23,590 --> 00:02:24,890 l dash OK. 34 00:02:25,120 --> 00:02:27,400 And as you can see my file is here. 35 00:02:27,430 --> 00:02:34,420 So if I want to bring it back to life I will say that I want to and my new file name I will just remove 36 00:02:34,420 --> 00:02:40,720 the dot from the beginning of the file name and this will bring it back to life. 37 00:02:40,960 --> 00:02:45,820 I'll clear my my screen here as you can see we want to come back to life. 38 00:02:45,820 --> 00:02:47,430 So now it's visible again. 39 00:02:47,590 --> 00:02:55,720 So in general if you have a file name and you want to make it hidden You just have to put one dot inside 40 00:02:55,720 --> 00:02:57,610 your new file name. 41 00:02:57,850 --> 00:02:59,650 And if you have a hidden file 42 00:03:02,560 --> 00:03:10,720 which begins with one dot of course all you need to do is just just you know remove any DOT beginning 43 00:03:11,130 --> 00:03:14,160 any dot from the beginning of the file. 44 00:03:14,260 --> 00:03:15,250 Perfect. 45 00:03:15,430 --> 00:03:22,420 So right now we know how to rename files and how to make a file hidden and how to make a hidden file 46 00:03:22,420 --> 00:03:23,270 visible. 47 00:03:23,440 --> 00:03:24,740 Perfect. 48 00:03:24,820 --> 00:03:27,070 So let's proceed from here. 49 00:03:27,520 --> 00:03:34,690 Let's make another directory or directory we call directory one and let's say for example I want to 50 00:03:34,690 --> 00:03:37,620 move one to two directory one. 51 00:03:37,630 --> 00:03:41,910 I want to physically move the file one to two directory one. 52 00:03:42,070 --> 00:03:44,670 So what do I mean by physically move it. 53 00:03:44,710 --> 00:03:47,980 I mean that I don't just want to copy it inside. 54 00:03:48,160 --> 00:03:54,020 I just want to put it inside directory 1 so 1 2 will not be longer on my desktop. 55 00:03:54,250 --> 00:03:58,550 And I guess for Windows users they are used to the word cut. 56 00:03:58,590 --> 00:04:05,200 You would say I want to cut the file into two directory one and put it inside directly one. 57 00:04:05,260 --> 00:04:12,370 You can also achieve this with the M.V. command your remove command and in general if you have more 58 00:04:12,370 --> 00:04:18,730 than one file like file one file to file three that you have many files that you want and then you have 59 00:04:18,730 --> 00:04:22,940 to move them into a destination folder. 60 00:04:23,070 --> 00:04:26,430 So this is how you can move files. 61 00:04:26,460 --> 00:04:30,350 So in this case I have one too. 62 00:04:30,630 --> 00:04:33,090 And I want to move it inside of directory one. 63 00:04:33,160 --> 00:04:34,540 This will do the trick. 64 00:04:34,630 --> 00:04:38,710 So if I open now directly one I have my file one too. 65 00:04:38,800 --> 00:04:41,850 And of course one two is no longer exist under. 66 00:04:41,840 --> 00:04:43,490 In my desktop. 67 00:04:43,510 --> 00:04:44,430 Perfect. 68 00:04:44,470 --> 00:04:47,680 And let's do this one more time with more than one file. 69 00:04:47,680 --> 00:04:56,330 So I have filed one file to file three and they want to move all the three files to directory 1. 70 00:04:56,350 --> 00:05:05,030 So I will say in the file one file two and file three and put them inside directory 1 71 00:05:07,990 --> 00:05:12,790 or No such file or directory of course because there is no file here. 72 00:05:12,790 --> 00:05:14,040 I have to say file one. 73 00:05:14,050 --> 00:05:21,190 So this this this actually moved the file to an file 3 but it did not move file 1 because I made a typo 74 00:05:21,190 --> 00:05:21,940 error here. 75 00:05:22,120 --> 00:05:23,400 I did not say file one. 76 00:05:23,410 --> 00:05:24,770 I just save files. 77 00:05:25,300 --> 00:05:29,230 So if I save file one directory one this will do it. 78 00:05:29,640 --> 00:05:30,220 OK. 79 00:05:30,250 --> 00:05:31,680 Perfect. 80 00:05:31,680 --> 00:05:36,610 So now inside of my directly one I have all these three files. 81 00:05:36,610 --> 00:05:37,430 Awesome. 82 00:05:37,480 --> 00:05:43,350 And let's make another thing here so let's make F1 F2 F3. 83 00:05:44,620 --> 00:05:54,770 And here I'll show you one saying If you want to move this refiled F1 F2 F3 to the rectory 10. 84 00:05:54,850 --> 00:05:56,930 This will tell you an error here. 85 00:05:56,980 --> 00:06:02,100 I cannot move these files in the directory and go directly to and does not exist. 86 00:06:02,110 --> 00:06:06,910 So if you specify a directory which does not exist this thing of course will not work. 87 00:06:06,910 --> 00:06:12,730 So this is just I will show you that you have to specify a target or a destination directory which exists 88 00:06:12,760 --> 00:06:13,510 already. 89 00:06:14,250 --> 00:06:15,330 Perfect. 90 00:06:15,410 --> 00:06:16,660 I actually want. 91 00:06:16,890 --> 00:06:21,920 OK so now you know how to move files to directories. 92 00:06:22,890 --> 00:06:25,890 What about moving directories to another directory. 93 00:06:25,890 --> 00:06:37,220 So if I have the to hear actually you know what that's delayed F1 F2 F3. 94 00:06:37,280 --> 00:06:41,090 OK so now right now I have two directories directory one and directory too. 95 00:06:41,520 --> 00:06:41,950 OK. 96 00:06:41,970 --> 00:06:48,480 Before I actually would know how to move the directory to another directory first I would just want 97 00:06:48,480 --> 00:06:55,320 to tell you that you can that you can rename a directory the same way that you can redeem a file. 98 00:06:55,440 --> 00:07:06,850 So if I want to rename directory to and I want to go for example directory 22 this will do the trick. 99 00:07:06,880 --> 00:07:10,210 This will rename the directory to two directory 22. 100 00:07:10,210 --> 00:07:19,240 So for example if I have a touch I make a file inside of directory 22 I'll call it hello. 101 00:07:19,510 --> 00:07:28,760 Right now inside of directory 22 I have hello and I want to rename directory Twenty-Two to directory. 102 00:07:28,760 --> 00:07:35,330 Again this will just do a renaming and the file hello will or will still exist. 103 00:07:35,350 --> 00:07:40,750 So you can rename a directory the same way that you can rename a file. 104 00:07:40,870 --> 00:07:41,460 Perfect. 105 00:07:41,470 --> 00:07:48,280 But now if you want to move a directory into another directory physically move it then you just say 106 00:07:48,280 --> 00:07:55,380 M.V. directory that your directory name and then your destination directory the same exact way. 107 00:07:55,390 --> 00:08:00,030 So I want to move directly to to directory 1 and this will do it. 108 00:08:01,980 --> 00:08:05,380 I can see directly to those no longer exist here. 109 00:08:05,520 --> 00:08:09,230 And if I open directory one you would see directory 2 inside. 110 00:08:09,570 --> 00:08:11,250 So every command is very easy. 111 00:08:11,250 --> 00:08:14,130 You don't need to use the dash or option. 112 00:08:14,130 --> 00:08:20,820 You don't need to use the dash option that we used with the r.m command and with the C-p command which 113 00:08:20,820 --> 00:08:25,330 makes life easier when you use the M.V. command you have fewer options. 114 00:08:26,250 --> 00:08:30,710 Okay perfect Let's OK. 115 00:08:30,730 --> 00:08:37,080 So right now we are done with the MBA command but we have to mention one command option that you can 116 00:08:37,080 --> 00:08:40,680 use with the M-B command which is the dash. 117 00:08:41,040 --> 00:08:47,200 And that's the same like the C.P. command is the interactor which is also the same as the air or in 118 00:08:47,340 --> 00:08:48,450 command. 119 00:08:48,480 --> 00:09:01,140 So if you have a file one here so file one on my desktop and of course as you as you may remember I 120 00:09:01,140 --> 00:09:09,030 have another file one here in my directory one and both like both of these files are empty file one 121 00:09:09,360 --> 00:09:12,070 here is empty and file one here is empty. 122 00:09:12,420 --> 00:09:25,990 So let's say Here I will say I like when two and I want to overwrite file one on my desktop to file 123 00:09:25,990 --> 00:09:28,710 one on my directory one I want overwrite. 124 00:09:28,720 --> 00:09:34,120 So all I need to do is just say in the file 1 and then move it to directory one. 125 00:09:34,330 --> 00:09:42,400 So if I used the dash I option as you may remember from the C.P command it will ask for your confirmation. 126 00:09:42,760 --> 00:09:44,950 Do you want to overwrite the file. 127 00:09:45,280 --> 00:09:52,630 I would say yes and this will this will move the file though it will not copy it because we're dealing 128 00:09:52,630 --> 00:09:54,070 here with the command. 129 00:09:54,290 --> 00:10:01,930 So it moved as a file one from desktop and it overwrites the file which is in my directory. 130 00:10:01,990 --> 00:10:04,780 And of course he would see the line I like wouldn't too. 131 00:10:05,440 --> 00:10:12,560 If he did not use the dash i option it will not ask for your confirmation message when overwriting. 132 00:10:12,610 --> 00:10:18,870 This is the only difference to dash I will display a confirmation like that it will ask for confirmation 133 00:10:19,210 --> 00:10:26,320 but without specifying the dash I it will overwrite without your permission or without your confirmation. 134 00:10:26,320 --> 00:10:28,120 So that's it for this video. 135 00:10:28,120 --> 00:10:32,560 So let's do a very quick summary if you want to rename a file. 136 00:10:33,100 --> 00:10:39,310 So if you want if you want to rename file one to file to your just say file one file to if you want 137 00:10:39,310 --> 00:10:45,500 to rename directory one into the directory to will just say directly or indirectly to of course. 138 00:10:45,790 --> 00:10:51,480 I assume here that the does not exist because if it existed this will move directly one inside of the 139 00:10:51,480 --> 00:10:55,440 directory to the like just to be aware of that right. 140 00:10:56,420 --> 00:11:02,720 If you want to make file one hidden you will just say file one file one if you want to make that file 141 00:11:02,720 --> 00:11:08,070 one visible You will save for that file one file one and so on. 142 00:11:08,080 --> 00:11:11,900 You know so that's it for the M.V. command. 143 00:11:11,900 --> 00:11:17,330 I hope you enjoyed it and now you can now you know many things you know how to remove files you know 144 00:11:17,330 --> 00:11:22,370 how to copy files how to move and rename you know old bunch of stuff. 145 00:11:22,370 --> 00:11:30,170 So right now we learned enough commands that you are kind of comfortable to work with the command line 146 00:11:30,650 --> 00:11:37,320 and from the next videos you'll learn much more and you will one day you will be a command line master. 147 00:11:37,340 --> 00:11:40,340 Until then I'll see you sow.