Skip to content

macOS: Permission denied: /var/root – code: 13 (eza as ls)

Linuxtested on zsh 5.9, eza, macOS 15.6 (Apple Silicon)

A plain ls on /var/root fails. The message looks unfamiliar because ls is an alias for eza in the course; code 13 is the error number EACCES – no permission.

Symptom

ls /var/root
Permission denied: /var/root - code: 13

code: 13 is the error number EACCES (Permission denied).

Diagnosis

In the course ls points to eza, so the message comes in eza's format.

alias ls='eza --group-directories-first'

Causes

/var/rootRoot's home directory

On macOS root's home is /var/root and only readable by root.

code: 13Error number EACCES

13 is the system error number for missing permissions – the same cause GNU ls reports as “Permission denied”.

Fix

Repeat the last command deliberately with sudo. The course function please shows it first and asks (“Ausführen?” means “Run?”).
please
sudo ls /var/root
Ausführen? [y/N] n

Don't: Build a please helper without a prompt. It runs whatever is in the history with root rights via eval.

▶
Break it yourself and find it – free
The Mac terminal hands-on, Day 5: aliases, functions and a toolbox with extract, port and please.
Go to day 5 →

FAQ

How do I use the original ls instead of eza?

With \ls or command ls.

Is repeating commands with sudo dangerous?

Yes, if you cannot see what runs. That is why please shows the command and asks first.

Related error patterns

More