rmdir
remove an empty directoryrmdir deletes a directory and refuses if anything is still inside it. That refusal is the point: it cannot destroy files by accident, which rm -r can.
The safe way to remove a directory: it only works when there is nothing to lose.
At the terminal
Read the session first, then the notes: each numbered line in the output is answered by the note with the same number.
What the numbered lines are telling you
old-reports was empty and is gone. Like most commands, rmdir prints nothing when it works.
Nothing was removed. The error is the safety feature doing its job.
A hidden file was inside. ls -a shows dot files; plain ls would have shown nothing.
Each directory is removed once the one inside it has gone, as long as each is empty in turn.
Switches
A switch changes how the command behaves. These are the ones used day to day; man rmdir lists the rest. Single-letter switches can usually be joined, so -l -a may be written -la.
-p- Parents: remove each directory in the path as it becomes empty.
-v- Verbose: print each directory removed.
--ignore-fail-on-non-empty- Do not report an error for directories that are not empty.
Variations worth knowing
The same tool, pointed at a narrower question. These four cover most of what it is reached for day to day.
rmdir dir1 dir2 dir3Removes several empty directories at once.
find . -type d -empty -deleteRemoves every empty directory beneath the current one.
rmdir --ignore-fail-on-non-empty */Removes the empty ones and stays quiet about the rest.
rm -r projectRemoves a directory and all its contents — the tool for when it is not empty.
In cybersecurity
Choosing rmdir over rm -r is a habit that prevents accidents.
A cleanup script that uses rmdir fails loudly if a directory unexpectedly has contents, instead of deleting them.
A mount point is an empty directory. Removing it makes the mount fail at next boot.
What decides whether you may remove a directory is the permission on the directory that contains it, not on the directory itself.