{
  "id": 11511043,
  "title": "OverTheWire Bandit Level 2 Writeup — Read a Filename With Spaces",
  "url": "https://urgent.news/2026/10/02/overthewire-bandit-level-2-writeup-read-a-filename-with-spaces",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-02T19:39:52.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/ctfdojo/overthewire-bandit-level-2-writeup-read-a-filename-with-spaces-32o2"
  },
  "original_language": "en",
  "account": "The OverTheWire Bandit level 2 writeup focuses on accessing a file named \"spaces in this filename\" located in the home directory. This file's name contains spaces, which poses a challenge for the shell when it comes to interpreting the filename properly.\n\nUpon logging in as bandit2, the recommended first step is to list the files in the home directory using the `ls` command. However, when attempting to directly access \"spaces in this filename\" without addressing the space issue, the command will split the filename into separate arguments due to the shell's behavior of treating unquoted spaces as argument separators.\n\nTo resolve this, two techniques are suggested: quoting the filename using double quotes (`\"`) or escaping each space with a backslash (`\\`). Both methods ensure the shell treats the entire filename as a single argument. For example, typing `cat \"spaces in this filename\"` or `cat spaces\\ in\\ this\\ filename` will successfully read the file's contents, thereby revealing the password for the next level (bandit3).\n\nThe writeup emphasizes the importance of using proper quoting or escaping techniques when dealing with filenames that may contain special characters, such as spaces. It also highlights the convenience of relying on tab-completion, which automatically escapes special characters for the user, eliminating the need for manual intervention. By following these recommended practices, users can effectively navigate through the OverTheWire Bandit challenges and progress to higher levels.",
  "summary": "The password file is named spaces in this filename . The shell splits unquoted arguments on whitespace, so the filename has to be quoted or escaped to be treated as one argument. Platform: OverTheWire Bandit Category: Linux Fundamentals Level: 2 → 3 Difficulty: Beginner Technique: Shell quoting and escaping Challenge description Level 2's home directory has one file, but its name contains spaces.…",
  "key_points": [
    "File named \"spaces in this filename\" has spaces in its name",
    "Shell splits filename into separate arguments without quoting",
    "Quote or escape spaces to read file contents successfully"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}