Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk1 min

How to Read the File Named `-` in Bandit Level 1

Use cat ./- in the Bandit Level 1 home directory to open the file named exactly - and print its contents.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run cat ./- from the Bandit Level 1 home directory. The ./ prefix makes the single-dash filename an explicit path, so GNU cat opens the file and prints its contents instead of treating a bare - as standard input.

What Bandit Level 1 asks you to do

The OverTheWire Bandit Level 1 → Level 2 goal says the next password is stored in a file named - in the home directory. It lists ls, cd, cat, file, du, and find as commands that may help.

As an Amazon Associate I earn from qualifying purchases.

Bandit is intended for absolute beginners and uses successive levels to teach command-line concepts. The official overview publishes the SSH host bandit.labs.overthewire.org and port 2220. Check the official pages for current access details and credentials, which can change.

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

Read the dash-named file

  1. Connect to the appropriate Bandit account using the current access information from OverTheWire.
  2. Make sure you are in the account’s home directory, where the level says the file is stored.
  3. Run cat ./-. The file’s contents, including the next-level password, appear in the terminal.
  4. Use that displayed password to continue to the next level. Avoid relying on passwords copied from old writeups: OverTheWire notes that passwords occasionally change.

Why cat ./- works

In GNU Coreutils, a file operand consisting of a single - tells cat to read standard input, not to open a local file with that name. That behavior is documented in the GNU Coreutils 9.11 cat invocation documentation.

By contrast, ./- is a relative pathname: it means “the entry named - in the current directory.” The leading ./ makes the argument a path rather than the special bare-dash operand. GNU’s guidance also gives ./- as a way to refer to a file with this name.

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

Why not use cat -- -?

-- conventionally marks the end of option parsing, which helps when a filename begins with a dash and might otherwise look like an option. But it does not change GNU cat’s special meaning for a single-dash file operand. For this exact filename, use cat ./-.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.