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.
- Make sure you are in the
bandit2home directory. - Run
cat "./--spaces in this filename--". - 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.
Recommended Free Tools
#1 Best Overall
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.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.
Quick Recap
Best Value
Rank #4
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.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minute

