From the course: Linux: Files and Permissions

Unlock the full course today

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

Deleting files and dirs

Deleting files and dirs - Linux Tutorial

From the course: Linux: Files and Permissions

Deleting 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 in "mkdir ~/rmexercise" and hit enter. Now let's change into it by typing 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 dir {1,2}" and hit enter. Now, type in "touch dir1/file1.txt" and hit enter. And lastly, type in "touch file { a, b, c, d} .txt and hit enter. Here, I'm using brace expansion to create dir1 and dir2, as well as file a, file B, file C, and file D .txt. We can verify the directory structure by…

Contents