Back to Blog
Arnošt Havelka

Practice: File Organization

Practice organizing files using mkdir and mv commands.

Start Interactive Lesson
Practice: File Organization

Time to use your new skills! Organize a messy directory by creating folders and moving files into them.

The Scenario

Your Downloads folder is a mess. Files are scattered everywhere. Let's organize them by type.

Try the command

First: Create folders for Documents, Images, and Archives!

Build the command
mkdirDocumentsImagesArchives
mkdir Documents Images ArchivesCreate three folders for organization.
Terminal
C:\Users\User>mkdir Documents Images Archives

Step 1: Create Folders

Create three new directories to organize your files.

Command Prompt
/home/user/Downloads report.pdf photo.jpg backup.zip letter.txt
C:\Users\User>pwd ls

Step 2: Organize Files

Now move each file into its appropriate folder.

Try the command

Move files to their categories!

Build the command
mvfile.txtDocuments/
Documents/Move text files to Documents folder.
Images/Move image files to Images folder.
Archives/Move compressed files to Archives folder.
Terminal
C:\Users\User>mv file.txt Documents/

Organize systematically:

Command Prompt
Archives Documents Images letter.txt photo.jpg report.pdf backup.zip
C:\Users\User>ls

Verify Your Organization

Check inside each folder to confirm everything is in place.

Command Prompt
C:\Users\User>ls Documents/ ls Images/ ls Archives/

Key Takeaways


Knowledge Check

1 / 3

What's the first step in organizing a messy directory?

References

These documentation links provide authoritative details for the commands used in this article.

Up Next

Practice: Data Extraction

Combine grep, pipes, and redirection to extract and analyze data.