Skip to main content
Settings
Search
Appearance
Theme Mode
About
Jekyll v3.10.0
Environment Production
Last Build
2026-05-24 00:35 UTC
Current Environment Production
Build Time May 24, 00:35
Jekyll v3.10.0
Build env (JEKYLL_ENV) production
Page Location
Page Info
Layout default
Collection quests
Path _quests/0000/bashcrawl/armoury.md
URL /quests/0000/side-quests/armoury/
Date 2026-05-22
Theme Skin
SVG Backgrounds
Layer Opacity
0.6
0.04
0.08

Bashcrawl Armoury: File Permissions and Script Execution

By IT-Journey Team

Learn chmod, file permissions, and script execution in Bashcrawl's Armoury. Brew a health potion and wield a sword for your first combat encounter.

Estimated reading time: 4 minutes

Racks of weapons line the walls. Suits of armour stand at attention. But every sword and potion is locked behind a permission barrier — you must learn chmod before you can equip a single item.

🎯 Quest Objectives

  • Read ls -l output and interpret permission bits
  • Use chmod to make scripts executable
  • Run ./potion to restore health
  • Run ./sword to equip your weapon
  • Defeat the armoury guardian
  • Proceed to the Chamber

�️ Quest Prerequisites

⚡ Command Cheatsheet

Command What It Does
ls -l Long listing — shows permissions, owner, size
chmod +x file Add execute permission for everyone
chmod 755 file rwxr-xr-x — owner can all; others can read+execute
chmod 644 file rw-r--r-- — owner can read+write; others read only
./script Execute a script in the current directory

Permission String Decoder

-rwxr-xr-x
│└──┘└──┘└──┘
│ u   g   o
│ user group others
└── file type: - = regular, d = dir, l = link

Each group: r = read (4), w = write (2), x = execute (1)

Octal shorthand: 755 = rwx r-x r-x, 644 = rw- r-- r--

🗺️ Walkthrough

Step 1 — Inspect the armoury

ls -l
# -rw-r--r-- 1 user group  512 Jan 01 potion
# -rw-r--r-- 1 user group 1024 Jan 01 sword
# -rwxr-xr-x 1 user group  256 Jan 01 guardian*

potion and sword lack the x bit — they are not yet executable. You cannot run them.

Step 2 — Try running a locked script

./potion
# bash: ./potion: Permission denied

This is the expected result. Now fix it.

Step 3 — Grant execute permission

chmod +x potion
chmod +x sword
ls -l potion sword
# -rwxr-xr-x 1 user group 512 Jan 01 potion*
# -rwxr-xr-x 1 user group 1024 Jan 01 sword*

Step 4 — Drink the potion

./potion
# HP restored: 50 → 100

Step 5 — Pick up the sword

./sword
# Sword of Echoes added to inventory.

Step 6 — Face the guardian

./guardian
# A stone golem steps forward...
# You raise your sword...
# [combat sequence]

With the sword equipped, you should win. Health permitting, the guardian falls and the door to the Chamber opens.

💡 Understanding Octal Permissions

Octal Symbolic Who Can Do What
777 rwxrwxrwx Everyone can read, write, execute ⚠️
755 rwxr-xr-x Owner: all; others: read + execute ✅
644 rw-r--r-- Owner: read + write; others: read only ✅
600 rw------- Owner only — private files 🔒
400 r-------- Read-only, even for owner

Security note: Never use chmod 777 on scripts or sensitive files. Use 755 for scripts and 644 for data.

💡 Common Pitfalls

Problem Cause Fix
Permission denied after chmod Not the file owner Use ls -l to check owner
Script does nothing Missing shebang line Add #!/usr/bin/env bash as line 1
No such file: ./sword Wrong directory pwd and ls first
Health still low after potion Bug in game version Run ./setup.sh --repair

✅ Validation

  • You can read a permission string like rwxr-xr-- without looking it up
  • You understand why ./ is needed to run a script
  • You ran both ./potion and ./sword successfully
  • The guardian is defeated and the Chamber door is open

➡️ Next Steps


📚 External Resources

Continue your terminal adventure with these resources:


Sword in hand, potion consumed. The Chamber awaits. ⚔️