Moving Stuff
Start course
1h 16m

This course provides an overview of Kali Linux and some of its main components and features. We'll also take a look at Linux in general including how it looks, how to use it, how to use the command line, how to change the settings, and more. We recommend taking this course as part of the Web Penetration Testing & Bug Bounty Hunting learning path.

Intended Audience

This course is intended for anyone who wants to learn the basics of Kali Linux, with a view to becoming an ethical hacker and/or a bug bounty hunter.


To get the most out of this course, it would be beneficial to already have some experience with Linux.


Hi, within this lecture we're going to focus on moving, deleting, the files and folders in order to master the navigation. So, right now I'm going to go into the documents. And if I write 'ls' I can see that 'notes.txt' and 'test' and 'test2' folders are over here. Obviously, you can create your own files and folders in order to test this stuff. So, we are obviously inside of home/Kali/Documents. And I know that there are other folders inside of 'Home/Kali.' Because I can see them like: Downloads, Music, Pictures, Public and stuff. So, assume that I want to put the 'notes.txt' into Test folder. So, maybe I want to move it. Maybe I want to copy it. I can do both by cutting or copying the thing over here. Because it's very basic to do so. And you know how to do that from Windows and other operating systems. But, idea over here is to learn how to do that within the terminal, and it appears that the commands to do that are very easy. There are two commands: 'cp' and 'mv'. 'Cp' stands for copying, 'mv' stands for moving. So, moving is like cutting the file and pasting into someone else, like some other folder and copying is just copying the file and pasting in some other folder. So, we're going to see both. Let's assume that I want to copy the 'notes.txt' into the Test folder. So, I can do that, copy 'notes.txt'.

But, I can't do that because I'm inside of the Documents. If I run 'ls' I can see 'notes.txt'. Let's assume that I want to do that from another folder. Let's assume that, I'm inside of the Downloads but I still want to copy the 'notes.txt' inside of the Documents. So, maybe I can explicitly state that it's, 'home/Kali/Documents/notes.txt'. But, since I'm inside of the Documents, I can just do that: 'copy notes.txt'. All I got to do is just to state where I want to copy this. So, I want to copy this inside of the Test folder. And also, I want to state the file name that I will be copying like 'test/notes.txt'. I can just state another file name here as well, but I'm just going to keep it as 'notes.txt'. So, you can write 'copy notes.txt' at the right side if you want to rename this while copying. So, if I run that, it will just execute this command and it will copy the 'notes.txt' and paste it under the Test folder. So, let's do that. And let's see the into or let me run 'ls'. As you can see, 'notes.txt' is still here. Let me go into the 'Test', and if I write 'ls', here you go, 'notes.txt' just appeared over here because I've copied it. Okay, now we have seen copy. So, you write the thing that you may want to copy and you write the thing that you may want to move that into. So, this is how copy works. So, let's see, we are inside of 'Test' and we still have 'notes.txt'. Let's assume that I want to delete it. So, in order to delete it, I can use 'rm' command which stands for removing. If you execute this command, here you go, you deleted 'notes.txt'. Which is cool. All you got to do is just write this command. Obviously, right now, if I write 'ls', you won't see anything. And obviously, if I go back to the Documents, I can still see the 'notes.txt' over there because I have only deleted the copy of it. And by the way, you don't even have to know everything about these commands. Because it's just simple right now, but it may get complicated after a while, and all you got to do is to understand the logic behind this, and maybe you may want to familiarize yourself. In order to read the documentation. So, let me do an example. So, I'm going to create a folder over here with 'rmtest'. So, it's just a folder inside of the Test folder. It's just a folder. I can see that. When I write 'ls', I can see the 'rmtest'. Let me try to delete that by removing it. So, as you can see, it gives me an error. It says that 'Cannot remove 'rmtest': it's a directory.' So, it seems that the 'rmtest' is a folder and we cannot actually delete the folders with 'rm' command. So, let me run this. Let me run 'rmhelp' to see the documentation about 'rm'. So, 'rm' is actually a binary and like a executable. And, they all have this documentation. Most of the time, you can reach them by adding this '--help' at the end of the command. So that it can actually show you the documentation: the help module of the rm binary. If you do that, I'm not even sure if it's going to show us. But if it's not '--help', it's something like '-h'. And as you can see, it shows us the usage; it shows us the different parameters that we can give to 'rm'. And , if I take a look over here, there is some parameter called '-r' and it says that 'remove directories'. So, maybe I'd forgotten how to remove the directories or delete the directories. I can just see that by writing 'rm--help'.

For example, there is another parameter over here, '-f'. It's just deletes the thing with '-f' with force. So, no matter what, it just deletes the thing. So, as you can see, 'rmtest' is a folder and let me write this, 'rm -r' and 'rmtest'. And here you go. Now, it got deleted. So, let me try to write 'ls'. And here you go, we don't have anything else. Let me just create it one more time and I'm going to show you 'rm -rf'. And again, this is by force. It means that just delete the thing without thinking anything else. So, even if you get like a warning message  or error messages, delete the thing. And here you go. It just deletes the thing. So, just bear that in mind: 'rm -r', 'rm-rf'. So, let me go back to Documents. As you can see, 'notes.txt' is over here because we have just deleted the copy of it. So, let me try, move. Move, takes in the arguments exactly like in the copy. So I want to move that to 'Test2' this time. And here you go. It worked. So I want to move 'notes.txt' to 'Test2'. And as you can see, when I write 'ls', I cannot see it but if I go to 'test2', I can see it. That's the difference between moving and copying. So, moving is like cutting and pasting; copying is like copying and pasting. Just bear that in mind. And again, we are doing all of this stuff in order to get familiarized with the terminal. Great. Now, we've started to learn something. I believe we can stop here and continue within the next one.


About the Author
Learning Paths

Atil is an instructor at Bogazici University, where he graduated back in 2010. He is also co-founder of Academy Club, which provides training, and Pera Games, which operates in the mobile gaming industry.