Copy, Move, Rename & Delete Files

Muhammed El-LawendI
A free video tutorial from Muhammed El-LawendI
Freelance instructor / Course presenter / Youtuber
4.3 instructor rating • 3 courses • 104,627 students

Learn more from the full course

Complete Linux course: Become a Linux professional

Learn all the Linux skills that will get you a career as a professional Linux System Administrator

14:13:28 of on-demand video • Updated December 2018

  • By the end of the course , you will be a professional linux system administrator
English [Auto] Welcome to and you listen. And in this lesson we will talk about managing files. We will learn how to copy rename and delete files in Linux. OK now let's type PWT to check our current working directly. Let's Representer as you see we are in less than five directory. So let's table this to list files and directories which in less than five directory. OK as you see we have three directories and five files inside and five berichten. Now let's start managing those files and let's Kobie if one takes 60 to that one burek. So let's type the command which is C-p C.P is a copy command in Linux. After C-p we Times a source file which is if one TSTO in our case and after typings the source file we type with the destination the destination. Here is one directory. So this command will take a copy from one extreme and put it in one directory. Now let's press enter. And as you see I didn't get any error message which means that the C.P. command has been executed successfully. Now let's check if if 1.60 has been qubit to dial one or not. So let's type less dial 1 now press. And as you see we have successfully Coate. If one extreme to dial or one directory. Now let's see if 1.60 to dial 1 but this time I want to take a copy from 1.60 with a different name. So let's type. If 1.60 And as we said before or after the Seabee command we type in the source file then we type the destination. So let's try slash home slash and slash less than 5 slash 1 slash. If one hundred sixty this time I timed the full path in the destination to let you know that we can use the full power. And we can use a full path in both the source and destination so this command will take a copy from a foreign book the XTi and it will restore this copy in one directory with a new name for the file. That name is if one hundred sixty. Now let's press enter and let's type this one to list files and characters inside one directory. Now PRESENTER As you see now we have if one be texting and then you qubit file which is if one hundred sixty. Now let me clear the screen and let's try ls command. Now let's copy another file. Let's go see if to book the XTi to copy a file. I went with the C.P. command then the source file which is if to but tasty. After that I will time that destination which has two dots. OK. This command will Cobi to the text me to five parent directory. Now press enter and type well as then two dots to list files in less than five parent directory. Now Precentor as you see now from five parent directory has to be fine. Now let me clear the screen and let me tribalist and enter. OK now let's copy multiple files to the free directory to copy multiple files. I will type the cynical and then I will. Times are files name if one takes the space to in the three weeks t and for the DST then the type or connection which is the three directory. So this command will copy it for and see if to see if looked and a 4 x 3 2 they are free directory. Now press enter and now let's have it a file that we have Coppins up for 5s today or three. So let's type it as they are three the press enter as you see the three has if 1.60 if to do the XTi if 3.50 and a for the XTi. Ok sometimes you need to copy all files that has a specific extension. Let us say that I want to copiable text files from less than 5 directory to that document directory. To do that let's type Seabee asterisk but TGT slash home slash slash documents. So the asterisk here means whatever file name is just to be sure that the extension of the file is Boudi XTi. And to explain what is being done later as a minus read option to the C command. So this command will Kobie any XTi files to the command directory. Now let's press enter as you see that minus the shows me what happened. So if one XTi has been qubit to look as if to the Dixie has been going to the comments. And so now let's clear the screen. And by that we have learned how to copy files in Linux. So let's move on to the next part of our lesson and see how can we move files. That's the type ls and the enter to list files. Now let's move to the extreme today or two. So I will try in vain to XTi them to to use any command to move files in Linux and then you see the Envy's statement is the same as C-p command was the difference between two commands. Is that in the command of the file. So in the command is similar to socket in Windows. Now lets press enter. Let's roll. LS As you see if to the extreme is not less than five directly. And that's because we have moved to if $2.60 to their victory. Now let's let's define. And so I have to type in less than two. OK as you see if to do has been moved from listener directory to there to a directory that McCain has a stream. Now let's move multiple files to downloads directory. But first let me list files here. Now let's type in B then minus We then the source files if one takes the EF 3 XTi and therefore both takes the name of the destination directory that's home. Slash and slash downloads. Now Precentor as you see if 1.60 if 3.0 XTi And if for XTi have been moved to the downloads directory. Let me clear the screen and let me list files. Ok we have one file here which is if $5.60 let us see how can we rename this file. In Linux we use the NV command to rename any file let us see how we do then the file name then as a new file name. If five hundred sixty. So the M.V. command here where the name EF 5 5.6 sixty two f five hundred sixty. Now presenter and let's list files here but running the LS command as you see there is no 5:33 because we have changed its name to a five hundred sixty. And by that we have seen how to move and rename files using the M.V. command. So let's go to the last part in our lesson and let's learn how to delete files to delete files in Linux. Just type R M and the name of the file which you want to delete delete delete if five hundred sixty. So I will talk about him then. Five hundred sixty. No press enter and let's test files here. As you see if five hundred sixty is not there because we deleted it using the R M command we will take more examples of those are in command in next lesson for now that's all. Thank you for watching and see you next lesson.