Activity 9 - Remove the Bad File

Workshop Resources

So is definitely a bad file left by the hackers. We need to remove it and the directory holding it!

Remove the bad file!

rm is a command that removes files.
The format is: rm [filename].

rm permanently removes the file.

Remove the file we have decided is causing our problems. How can we check that the file was fully removed?

rm command

What if we need to remove a directory?

rmdir is a command that can remove an empty directory.
The format is: rmdir [directoryName].

rmdir permanently removes the directory.

How can you remove the directory that the bad file was in?

rmdir command

Removing files can be a dangerous operation, especially on Linux. Make sure that you are 100% certain the file you want to delete is safe to remove. By removing the wrong file, you could accidentally ruin your computer.

Do you remember the command to remake the directory that we deleted?

mkdir command

Now let’s go check if we know a command to restore the secret-message.txt file…