From the course: Linux CentOS 7: Files and Permissions

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Remove files and dirs

Remove files and dirs - Linux Tutorial

From the course: Linux CentOS 7: Files and Permissions

Start my 1-month free trial

Remove files and dirs

- [Narrator] We have a couple of commands dedicated to removing files and directories, namely rm and rmdir. You may want to note that on the command line, Linux doesn't have a recycle bin. If you delete a file, it is for all practical purposes, deleted. Be careful, recovering files requires extra work. Let's create a directory for this exercise and cd into it. In a terminal, type in mkdir space rmexercise and hit Enter. Then type in cd rmexercise and hit Enter again. You can verify your path by typing in pwd. Now that we have a directory and we've changed into it, let's create some files. Type in mkdir space dir left curly bracket, 1 comma 2, right curly bracket and hit Enter. I've used brace expansion to create two directories called dir1 and dir2. You can verify this by typing in ls. Now let's type in touch space dir1 slash file1 dot txt. This will create a file inside the directory named dir1. Let's create a couple more files by typing in touch space file, left curly bracket, a…

Contents