• Foundation
  • About 15 min
  • 5 practice questions

Files, folders, paths and file extensions

Explain files and folders, read a file path on Windows and Linux, follow the rules for naming files, and recognise common file extensions and what they mean.

If something looks wrong, please tell us.

Everything you save, from a letter to a photo, is kept as a file. If you understand how files are named and organised, you can always find your work again and you can follow any instruction about where to save something.

Files and folders

A file is a named collection of data stored on a disk, for example a document, a picture, a song or a program. A folder (also called a directory) is a container that holds files and other folders, called subfolders. Folders inside folders form a tree: one top level branching into many levels below.

Drives and the top of the tree

The top of the tree

  • Windows
    • Each drive gets a letter
    • C: usually holds Windows
    • Pen drives and DVDs get D:, E:, F:
    • Personal folders: C:\Users\Asha
  • Linux
    • One tree from the root directory /
    • Other drives appear under /media or /mnt
    • Personal files: /home/asha
  • Windows gives each drive a letter. C: is usually the drive with Windows on it; other partitions, pen drives and DVD drives get letters such as D:, E: and F:. Each user's personal folders are kept in a folder such as C:\Users\Asha.
  • Linux has a single tree that starts at the root directory, written /. Other drives appear as folders inside it, often under /media or /mnt. Each user's personal files are in a home folder such as /home/asha.

Paths

A path is the address of a file: the drive or root, then each folder in turn, then the file name. Windows separates the parts with a backslash (\); Linux uses a forward slash (/). A full path from the top is an absolute path; a path that starts from the folder you are in is a relative path.

SystemExample path
WindowsC:\Users\Asha\Documents\resume.odt
Linux/home/asha/Documents/resume.odt

Worked example 1: reading a path

Read C:\Users\Asha\Documents\resume.odt from left to right. C: is the drive. Users is a folder on it. Asha is a folder inside Users. Documents is a folder inside Asha, and it directly contains the file. resume is the file name, and .odt is its extension, which marks a word-processor document in the OpenDocument format. The parent folder of the file is Documents.

Reading a path

  1. C: The drive.
  2. Users A folder on the drive.
  3. Asha A folder inside Users.
  4. Documents The parent folder of the file.
  5. resume.odt The file name and its extension.

Naming files

  • Choose clear names, such as rent-receipt-march, so you can find files later.
  • On Windows a name cannot contain these characters: \ / : * ? " < > |
  • On Linux the forward slash is the only ordinary character that cannot be used in a name. Linux names are case-sensitive: Report.txt and report.txt are two different files.
  • Windows names are not case-sensitive: Report.txt and report.txt are treated as the same name.
  • On Linux a name that starts with a dot, such as .config, is a hidden file or folder.

File extensions

The extension is the part after the last dot in a file name. It tells the operating system which kind of file it is and which program should open it.

ExtensionKind of file
.txtPlain text
.odt, .docxWord-processor document (OpenDocument, Microsoft Word)
.ods, .xlsxSpreadsheet
.odp, .pptxPresentation
.pdfPortable Document Format, which looks the same on every device
.jpg, .png, .gifImages
.mp3, .wavAudio
.mp4Video
.zipCompressed archive holding one or more files
.htmlWeb page
.csvComma-separated values: table data as plain text
.exeProgram file on Windows

Worked example 2: changing an extension does not convert

Asha renames photo.jpg to photo.pdf, hoping to get a PDF. The contents are still a JPEG picture; only the label changed, so the PDF reader may refuse to open it. The correct way is to open the picture in a program that can export or print to PDF and save a new file. Rule: renaming changes the name, never the contents.

A file's properties (right-click, then Properties) show its type, size, location, the dates it was created and modified, and attributes such as read-only (cannot be changed) and hidden.

Path = drive or root + folders + file name + extension. Windows uses \, Linux uses /. Linux names are case-sensitive. The extension tells the type; renaming it does not convert the file.

Key takeaways: files hold data, folders hold files, and both form a tree. Read a path from left to right; the folder just before the file name is its parent. Learn the common extensions in pairs, such as .odt and .docx for documents.

Check your understanding

  1. 1. In the path C:\Users\Ravi\Documents\budget.ods, which folder directly contains the file?

    1. Users
    2. Ravi
    3. Documents
    4. C:
    Show answer

    Answer: C. The folder just before the file name is its parent: Documents. Users and Ravi are higher folders, and C: is the drive.

  2. 2. What kind of file is budget.ods?

    1. A presentation
    2. A spreadsheet
    3. An image
    4. A video
    Show answer

    Answer: B. The .ods extension is an OpenDocument spreadsheet, like .xlsx. Presentations use .odp or .pptx, images .jpg or .png, and video .mp4.

  3. 3. Which character separates folders in a Linux path?

    1. /
    2. \
    3. :
    4. |
    Show answer

    Answer: A. Linux paths use the forward slash, as in /home/asha/Documents. Windows uses the backslash, and the colon and vertical bar are not folder separators on Linux.

  4. 4. On Linux, can Notes.txt and notes.txt be kept in the same folder?

    1. No, they are the same file
    2. No, capital letters are not allowed
    3. They are merged into one file automatically
    4. Yes, they are two different files because Linux names are case-sensitive
    Show answer

    Answer: D. Linux treats capital and small letters as different characters, so these are two separate names. Capital letters are allowed, and nothing is merged.

  5. 5. What happens if you rename song.mp3 to song.mp4?

    1. The audio is converted into a video
    2. Only the name changes; the content stays audio and may not open properly
    3. The file is compressed
    4. The file is deleted
    Show answer

    Answer: B. Renaming changes only the label. The data inside is still MP3 audio, so a program expecting an MP4 video may not open it. Converting needs a program that actually changes the format.

Privacy · Terms · Refunds · Delivery