Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

From the bandit2 home directory, read the file with cat "./--spaces in this filename--". The quotes keep the spaces in one filename, and ./ makes the path explicit despite its leading hyphens. The output is the password for Bandit Level 3.

Read the Level 2 file

OverTheWire’s Level 2 → Level 3 instructions identify the file as --spaces in this filename--, in the home directory. Keep both pairs of hyphens exactly as shown.

  1. Make sure you are in the bandit2 home directory.
  2. Run cat "./--spaces in this filename--".
  3. Use the displayed contents as the credential when connecting to Bandit Level 3.

The command shows the current credential directly in your authorized game session; a public writeup should not reproduce the password.

Why the filename needs quotes and ./

Shells treat unquoted spaces as separators between command-line words. Without quoting or escaping, cat --spaces in this filename-- is passed several separate arguments rather than one filename, so cat cannot open the intended file.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The quotation marks group the path into one argument; the shell removes the quotes when it runs the command. The ./ prefix identifies a path in the current directory and means the argument begins with a dot rather than a hyphen. That avoids confusing a hyphen-leading filename with an option.

Equivalent command using escaped spaces

You can also escape each space with a backslash:

cat ./--spaces in this filename--

Both commands name the same file. Quoting the path is usually easier to read; escaping makes each protected space explicit. A dated walkthrough also describes quoting and escaping as alternatives for this challenge: Linux Handbook’s Bandit Level 2 walkthrough.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Useful checks if the command fails

  • Check that the filename includes the leading and trailing --.
  • Check that you are in the home directory; the official level places the file there.
  • Keep the spaces inside the quotes, or escape every space if using the alternative form.

OverTheWire lists ls, cd, cat, file, du, and find among commands that may help with the level. They are suggestions, not a requirement to use every command; for this file, cat is sufficient.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.