From the course: Raspberry Pi Essential Training

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Copy, move, and delete files

Copy, move, and delete files

- [Instructor] Now that you've learned how you can navigate between directories on your Rasberry Pi's file system, let's look at the essential commands for file manipulation. First, let's create a text file. Open a new terminal window and type nano myfile.txt. Next, type a couple of lines into the file. Press Ctrl + O to save the file, then Ctrl + X to exit it. And now you've got a file, so let's look at it with ls -l. You can view its contents with the cat program. Cat is short for concatenate because the cat program can also concatenate multiple files into one file. You can use the cp command to copy the file to another location. Let's copy it into your documents directory. Use ls to make sure it's there. You now have two copies of the file, so you can remove the original with the rm command. Use ls -l to confirm that it's gone. You can use the mv command to copy a file to a new location and remove the original. Mv is short for move. Let's move it to our current directory. The dot…

Contents