Skip to main content

Cleanup - Removing Directories and Files

5.1 Navigating to Parent of Tutorial Directory​

Required location: Your home directory (parent of linux_tutorial)

First, navigate to your home directory (parent of the linux_tutorial directory):

cd ~
pwd # Should show your home directory path
ls # You should see linux_tutorial directory listed

5.2 Removing Everything with -r Flag​

The -r flag means "recursive" - it will remove directories and all their contents.

⚠️ Warning: This command permanently deletes files. Use with caution!

Remove the entire tutorial directory and all contents:

rm -r linux_tutorial

Verify the deletion:

ls # linux_tutorial directory should no longer be listed

The linux_tutorial directory and all its contents (scripts, files, documents, backup, projects, etc.) should be completely removed.

5.3 Alternative Safe Removal Commands​

For safer removal, you can use:

rm -ri directory_name # Interactive mode - asks before each deletion
rm -rf directory_name # Force removal without prompts (use very carefully!)