PM & AI Chronicles

From Product Thinking to Prompt Engineering โ€“ One Tool at a Time

Managing an OS ๐Ÿ’ป: Files & Folder Structure ๐Ÿ—ƒ๏ธ๐Ÿ“‚๐Ÿ“„

This article is part of the Operating Systems Series โ€” where we explore how OS power and shape the world of computing. If youโ€™d like to know what operating systems are and why they matter, check out the main article: ๐Ÿ‘‰ โ€” Operating Systems: The Hidden Power

When you save a file โ€” maybe a document, a favorite photo, or a song โ€” it feels almost effortless. You just click Save, and the computer remembers it. But behind that simple action, your Operating System (OS) and Hard Drive (HD) are doing a lot of invisible teamwork.

Your hard drive is the physical component that holds everything โ€” all your data, system files, applications, and documents. The OS is the smart manager that knows exactly where each file lives and how to retrieve it when you ask. While the hard drive stores data as a long stream of 0s and 1s, the OS interprets those bits, keeps track of where one file ends and another begins, and ensures nothing gets misplaced. What we see โ€” a folder full of neatly named files โ€” is just the friendly, visual layer the OS provides to make life easy for us.

Now, imagine a brand-new hard drive fresh from the factory. Itโ€™s like a big, empty plot of land โ€” no walls, no rooms, just open space. Before you can store anything, the OS needs to prepare it properly. That preparation happens in two major steps: partitioning and formatting.

A partition is a logical section of the drive, like building rooms inside a house. Think of your hard drive as one large house. Partitioning is like putting up walls to divide that house into separate rooms โ€” one might be the kitchen, another the bedroom, and another the storage room. Each room has a purpose and a label on the door. Similarly, each partition gets a drive letter such as C:, D:, or E:.

Every hard drive must have at least one partition before data can be stored. Most computers use the C: drive for the primary partition, where the operating system itself lives. But large drives can be split into multiple partitions to organize data better โ€” for example, one for the OS and programs, another for documents or backups.

Once the partitions are created, the OS must format them โ€” this is like finishing the rooms by laying the floor, adding shelves, and organizing storage space.
Formatting lays down the internal structure โ€” called tracks and sectors โ€” that determine how data will be stored and retrieved efficiently. It also defines the file system, which is the set of rules that tell the OS how to name, store, and access files. In short:

  • Partitioning divides the space logically.
  • Formatting organizes that space physically.
  • The file system provides the method to keep it all neat and searchable.

After these steps, the OS can finally start installing system files and saving user data in an orderly fashion. From there on, when you open File Explorer or Finder and click through your folders, what youโ€™re really seeing is a well-organized map created by the OS to make all those 0s and 1s make perfect sense.

Once a partition is formatted, the file system steps in โ€” and this is where the real organization begins. The file system is like the librarian of your computerโ€™s storage, keeping detailed records of what is stored, where it is stored, and how to find it again when you need it.

Every time you save a new file, the file system decides where on the disk that file should physically go. Hard drives store data in tiny blocks or clusters, and the file system keeps a map of which blocks are used, which are free, and which belong to which file.

When you later open the file, the OS doesnโ€™t just โ€œrememberโ€ it magically โ€” the file system looks up its location in this map, gathers all the pieces from across the disk, and presents it to you as one complete file. So, in short, the file system:

  • Organizes folders (directories) and files.
  • Tracks the logical structure of everything stored.
  • Manages available and used disk space.
  • Handles reading and writing files efficiently.

Without it, your hard drive would be a chaotic jumble of 0s and 1s with no way to tell one file from another.

Every file needs a name so both you and the computer can identify it. But naming isnโ€™t as simple as it seems โ€” different file systems have different rules.

Some file systems have limits on how long a file name can be or which characters you can use. For example, in older systems like MS-DOS and FAT (File Allocation Table), filenames followed what was known as the 8.3 naming rule โ€” eight characters for the name, a period, and three characters for the extension.

So a valid file name might look like this: ๐Ÿ‘‰ REPORT01.TXT

But something like Annual_Report_2025.Version1.txt would be too long and invalid under those older rules. Special characters such as \ / : * ? ” < > | # were (and still are) not allowed, because they have special meanings in command-line and system operations.

This restriction meant users had to be creative and concise. For instance, a long name like โ€œQuarterlyBudgetSummaryโ€ might have to become: ๐Ÿ‘‰ QTRBUDGT.XLSโ€” short, meaningful, and still recognizable.

The file extension (the letters after the dot) tells the operating system what kind of file it is and which program can open it. Examples include:

  • .exe โ€” an executable file that runs a program.
  • .xls โ€” a Microsoft Excel spreadsheet.
  • .pdf โ€” an Adobe Portable Document Format file.

Extensions today can be longer than three characters, but each still carries a unique identity. For example, if you rename a funny picture to cat_video.pdf, your system will think itโ€™s a PDF and may try to open it with Adobe Reader, which will fail because itโ€™s not actually a document. The extension doesnโ€™t change whatโ€™s inside; it only changes how the OS interprets it.

In Windows 11, you can view or change which program is associated with each file type:

  • Open the Start menu and type โ€œAssociateโ€.
  • Choose โ€œChoose defaults by file typeโ€.
  • Scroll through the list and see which apps open which file types. If no default app exists, Windows will ask which one youโ€™d like to use when opening that file.

Directories (or folders) give your storage structure.

  • A flat directory means everything is stored at one level โ€” like piling every file in a single folder. It quickly becomes cluttered.
  • A hierarchical directory, on the other hand, allows folders within folders, like labeled drawers in a filing cabinet:

In most modern operating systems, directories are treated just like files themselves, with each folder entry pointing to the files (or sub-folders) inside it. This hierarchical structure keeps your digital world organized and easy to navigate โ€” whether youโ€™re using Windows Explorer, macOS Finder, or Linuxโ€™s file manager.

Every file on your computer carries more than just its contents โ€” it also comes with a hidden tag of details called metadata. Think of metadata as the โ€œfile about the file.โ€ It tells your operating system (and you) important information like:

  • ๐Ÿ“› File name โ€” what the file is called.
  • ๐Ÿ“ฆ File size โ€” how much space it takes up on the disk.
  • ๐Ÿ•’ Date modified or created โ€” when it was last saved or changed.
  • ๐Ÿงฉ Type โ€” what kind of file it is (text, image, program, etc.).
  • ๐Ÿ”– Location โ€” where the file is stored in the directory structure.

All of this information helps the OS organize and display files properly โ€” for example, when you sort your documents by Date Modified or Size, youโ€™re actually using the fileโ€™s metadata.

Along with metadata, each file also has attributes โ€” small flags that tell the operating system how to treat the file. Some common attributes include:

  • Read-only ๐Ÿ›‘ โ€“ the file can be opened and read but not edited or deleted accidentally.
  • Hidden ๐Ÿ‘ป โ€“ the file wonโ€™t appear in normal folder views unless you choose to show hidden files.
  • System ๐Ÿง  โ€“ marks files that are vital for the OS to function; these are usually protected from user actions.
  • Archive ๐Ÿ—‚๏ธ โ€“ indicates that a file has changed since the last backup and should be included in the next one.

These attributes work like rules attached to a file โ€” quiet but powerful instructions that help keep the system stable and organized.

Some file systems can automatically compress files, reducing their size to save disk space. When a compressed file is opened, the OS decompresses it on the fly so you can view or edit it normally. Itโ€™s like packing a sweater tightly into a suitcase โ€” it takes up less space, but you can unpack it whenever needed.

Common compressed file types youโ€™ll see are .zip, .rar, or .7z, but even within file systems like NTFS, compression can be applied automatically to reduce storage usage without changing the fileโ€™s visible format.

Another advanced feature offered by modern file systems is encryption โ€” turning readable data into coded text that only authorized users can decode. Itโ€™s like locking your diary with a key you alone possess. Even if someone gets hold of the file, they canโ€™t read it without the correct credentials.

Windows, for example, provides Encrypting File System (EFS) and BitLocker to protect data from unauthorized access. Encryption has become an essential security layer, especially for laptops and portable drives.

In short, metadata tells the story, and attributes control the behavior of your files. Together, they make sure your computer knows not just what a file is, but also how it should be handled, stored, and protected.

Beyond organizing files and folders, a file system also plays a vital role in keeping them secure. Every modern file system comes with a built-in set of permissions โ€” special rules that determine who can view, edit, or delete a file. These permissions are the digital equivalent of locks and keys for your computerโ€™s data.

Permissions control how users interact with files and folders. They ensure that only authorized people can perform certain actions. This helps protect critical system files from accidental changes or deletions โ€” and keeps private data safe from unauthorized access. In most operating systems, each file or folder has three basic permission types:

  • Read (R) ๐Ÿ“– โ€“ allows a user to open and view the fileโ€™s contents.
  • Write (W) โœ๏ธ โ€“ allows a user to modify or delete the file.
  • Execute (X) โš™๏ธ โ€“ allows a user to run the file if itโ€™s a program or script.

These permissions can be assigned to different categories of users:

  • Owner ๐Ÿ‘ค โ€“ usually the creator of the file; has full control.
  • Group ๐Ÿ‘ฅ โ€“ a set of users who share common permissions.
  • Others (Public) ๐ŸŒ โ€“ everyone else who might access the system.

For example, If youโ€™re working in a shared environment, you might allow your teammates (group) to read a report but prevent them from editing it, while completely blocking others from viewing it at all.

The administrator (or system owner) can adjust these permissions for any file or folder. In Windows, this is done through the Properties โ†’ Security tab, where you can see who has access and what level of control they have. In macOS or Linux, permissions can be managed through the File Info panel or via command-line tools like chmod and chown.

These settings ensure sensitive files remain protected while still enabling collaboration where needed.

Without file-level security, any user could modify system files, delete othersโ€™ documents, or run harmful software โ€” leading to system crashes or data loss.
By enforcing permissions, the file system adds a layer of accountability and security, ensuring that only authorized users can perform actions on your computer.

In short, file system security is the guardian of your data โ€” quietly working in the background to make sure files stay safe, organized, and only in the right hands.

When a change is made to a file, the file system has two choices on how to handle it:

  • Write the change directly to the disk, finishing the update immediately.
  • Use journaling, where the change is written not only to the main file but also recorded in a special log file called a journal.

This journal acts as a backup of recent changes. If your computer suddenly loses power or crashes while writing data, the journal can be used to recover unfinished updates and prevent corruption.

๐Ÿง  Think of journaling like writing a draft in a notebook before making changes to an important document โ€” even if something goes wrong mid-edit, you can look at your notes and fix things quickly.

File systems that use journaling are considered more fault-resistant and reliable, especially on systems that experience frequent writes or unexpected shutdowns (such as laptops or servers).

Over the years, dozens of file systems have been developed, each with its own structure and features. However, only a few are commonly used today, and most are tightly linked to specific operating systems.

Early PCs using MS-DOS (Microsoft Disk Operating System) relied on a simple file system called FAT (File Allocation Table) as the default. FAT kept track of where each file was stored on the disk and became widely associated with Windows.

Over time, FAT was improved to FAT16 and FAT32, adding features such as larger partition sizes and better performance. But as computers grew more powerful and data needs expanded, newer file systems emerged โ€” offering features such as journaling, permissions, compression, encryption, and support for larger storage volumes.

Today, different operating systems use different file systems optimized for their needs. For example, Windows primarily uses NTFS, macOS uses APFS, and Linux systems often use ext4 or XFS.

File SystemUsual OSNotes
File Allocation Table (FAT)WindowsObsolete; offers no security or journaling. Supports only small partition sizes. Replaced by FAT16, FAT32, and NTFS.
New Technology File System (NTFS)WindowsDefault file system for Windows. Provides support for large files, permissions, compression, encryption, and journaling.
Apple File System (APFS)macOSDefault for macOS and iOS since 2017; replaced the older HFS (Hierarchical File System). Offers encryption, snapshots, and better performance for SSDs.
Fourth Extended File System (ext4)LinuxModern Linux file system; supports large volumes and up to 64,000 subdirectories in a single directory. Replaced ext3.
Extended File System (XFS)LinuxHigh-performance file system; supports large partitions and efficient handling of big files. Often used on enterprise servers.
Universal Disk Format (UDF)โ€”Commonly used for optical media such as Blu-ray discs and DVDs. Enables data interchange across systems.

๐Ÿ’ก Note: If files are stored using a file system that the operating system doesnโ€™t recognize, the OS wonโ€™t be able to read them. Thatโ€™s why a drive formatted for macOS may not open on Windows without special tools, and vice versa.

When your hard drive starts filling up, Windows gives you built-in tools to check whatโ€™s taking up space and to clean it safely. Follow the steps below to explore your drive properties, identify your file system, and perform a disk cleanup.

  • You can do this in a few ways:
  • Press Windows + E to open File Explorer.
  • In the left pane, click This PC.

This view shows all your connected drives (C:, D:, external, etc.).

  • Locate your C: drive (the main Windows drive).
  • Right-click it and choose Properties. Youโ€™ll see a window similar to the one:
    (C: Properties โ€” showing used and free space in a pie chart)

In the General tab, look for File system.

  • If youโ€™re running Windows, it will most likely say NTFS (New Technology File System). This tells you how files are stored and managed on that drive.

Still in the General tab, note how much Free space and Used space you have.

  • Ideally, try to maintain at least 10% free space on your main drive to keep your computer running efficiently.

At the bottom of the Properties window, youโ€™ll see a checkbox labeled Compress this drive to save disk space.

  • Turning this on will free some space, but it can also slightly slow file access because files must be uncompressed every time theyโ€™re opened.
  • You can also click the Details button to see how much space different file categories are using.

(Note: On SSDs, compression is rarely needed.)

  • Once youโ€™ve reviewed your drive information, click Cancel or OK to close the Properties window.
  • In the Windows search box, type Disk Cleanup and press Enter.
  • Choose C: and click OK. Windows will analyze your drive and show how much space can be freed.

The Disk Cleanup window displays a list of file categories โ€” such as Temporary Internet Files, Recycle Bin, Thumbnails, and System-created files โ€” along with the space they occupy. Here, you can see exactly how much space each category takes up.

  • Check the boxes next to the file types you want to delete.
    • Safe choices: Temporary files, Recycle Bin, and Thumbnails.
  • Click OK, then confirm by selecting Delete Files. Windows will begin cleaning up unnecessary data and show progress as it removes those files.

Run Disk Cleanup regularly โ€” about once a month โ€” to keep your system running smoothly. You can also schedule Storage Sense in newer Windows versions to automate this process.

Understanding how your operating system manages storage gives you a clearer picture of what happens behind the scenes every time you save, open, or delete a file. From partitions and file systems to journaling and cleanup tools, these processes ensure your data stays organized, secure, and recoverable.

Regularly checking your disk space, cleaning temporary files, and maintaining at least 10% free space keeps your system healthy and responsive โ€” just like routine maintenance keeps a car running smoothly.

Now that you know how files are stored and managed within the OS, itโ€™s time to move to the next part โ€” โ€œNavigating the File Structure & Viewing File Metadataโ€ โ€” where weโ€™ll explore how to move through folders, understand file paths, and view the hidden details each file carries. ๐Ÿ‘‰ Navigating & Viewing