From the course: Practical Linux for Network Engineers: Part 1

Unlock this course with a free trial

Join today to access over 22,500 courses taught by industry experts.

Copy, move, and delete, part 2

Copy, move, and delete, part 2

- You can also delete files in the same way as on Cisco, by using the remove, or rm, command. On Cisco, we could delete files from Flash. This file currently exists in Flash, but we could say delete shrun1.txt. We're asked whether we're sure we want to delete the file, and I'm gonna press enter, and then we're asked to confirm whether we want to delete that file. Deletion is obviously removing information, so the router wants to be sure that we want to do that, so it asks for confirmation. Drr now shows us that the file is missing. So currently, in this directory, we have this file. If I cat to that, we can see the contents of the file. But I can use rm to remove the file. So rm newfile1234. Notice the file is removed from the directory. In this case, there was no prompt to remove the file. Cat, and myfile2, contains that. Rm, myfile2, notice the file is missing. So tree now shows us those directories and files. If I try and remove the directory test, that's not allowed, because it's…

Contents