`systemctl` is the systemd command line tool for inspecting and manipulating services/units. `systemctl status` is the command for showing the status of a service or unit.
The `--` part is not specific to systemd at all, it's used in many commands to separate flags from positional arguments. This lets you use positional arguments that might happen to start with a dash without them being interpreted as flags. [1].
systemd manages mounts, they're named according to the mount point, with a transformation to turn it into a filename (mostly converting slashes to dashes, plus a .mount suffix). Hence, the root mount ('/') is named '-.mount'.
[1] See, e.g., https://unix.stackexchange.com/questions/11376/what-does-dou...
I wish they had picked ':' for '/' instead of '-'. That one would be pretty uncommon to find in a mount path, and has a bit of precedent on OSX.
(Who would ever mount anything on a path with a colon anyway? That would be as silly as using slashes instead of dashes for options)
https://www.freedesktop.org/software/systemd/man/systemd-esc...
Hint: to specify units starting with a dash, use "--":
systemctl [OPTIONS...] COMMAND -- -.mount ...
I found my mount names by running systemctl list-units, so it's not something I had to look up. systemctl status *.mount
Just shows the status of all mount units.It's the same command you'd use to check any other systemd unit, for example, if you want to check Docker's status:
systemctl status docker.service
Seems consistent and discoverable as long as you have a surface understanding of systemd units. find ~/Code -type f -name *.js
Where *.js isn't using the shell glob feature, it's just a regex compatible string.You could put quotes around it to make it clearer:
systemctl status "*.mount"
The string is matching on unit names, and the mount units have the .mount suffix.Except it isn't, because a `*` at the start of a regex is invalid. `-name` patterns given to `find` are explicitly shell glob patterns. You might be thinking of `-regex` patterns, which GNU find also has.
It's a bit shonky when `find` does it because it's not saying "the shell pattern applies in this directory", and I regularly trip over it. It's something special you've got to know about how `find` works, but at least it's still anchored to the idea of being searched in a path that's also part of the command. There's a semantic link there.
With `systemctl status *.mount` you've not even got that. What path is being searched for `*.mount` files? Is that path part of the `systemctl` interface? Or is this just another way that `systemctl` insists on being a special snowflake that someone's decided I now need to devote neurons to?
systemctl status -- $(systemd-escape --suffix=mount --path /)
be simpler to read?