From the course: CompTIA Linux+ (XK0-005) Cert Prep

Unlock the full course today

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

Remove files and dirs

Remove files and dirs

- 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 does not 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. Type an mkdir space tilda/rmexercise and hit enter. Now let's change into it by typing in cd space tilda/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 brace one, two right curly brace and hit enter. Now type in touch space dir1/file1 .txt and hit enter. And lastly, type in touch space file, left curly brace, a, b, c, d right curly brace .txt, and hit enter. Here I'm using brace expansion to create dir1 and dir2 as well as filea, fileb, filec…

Contents