Let's talk about pathnames.
A pathname is the full name from the root directory to a file. Well, that is, if it's an absolute pathname.
Absolute path means that there cannot be any doubt about where your file is.
Vars Log messages is an example of an absolute path name.
There's also the relative path, and the relative path is related to the current
directory and it contains the rest that is needed to get to a file.
If your current directory is set to var logmessages is a relative path.
In relative paths you can use for one directory up.
That means that if the current directory is var cache,
then log messages point to the var log messages file.
If I may give you a Always use absolute paths.
To avoid any confusion, let me demonstrate.
When I go to the var directory and I use LS l var log messages,
then that's an example of an absolute path name, and that will always work.
I like absolute paths because you don't have to think about your current location.
But if I would use LS l logmessages, then then it's going to
make it relative to the current directory and then it also works.
Even you could use dot slash log messages, where the dot slash is not really necessary, but
dot is your current directory, and this means in the current directory, look for log messages.
Now let's go somewhere deeper into the empty directory.
What is this empty directory all about? Well, it's an empty directory, probably. That makes sense.
Now how about I use LS on log messages? Does that work? No, it doesn't work because it would look
in the current directory for a subdirectory with the name log and then for a file with the name messages.
We can fix that by putting in front of it, which means that it goes
up from var empty to var, and and in var it looks for log messages.
And that would work.
And as I told you, if you think that is complex, well, just make it an
absolute path, because absolute paths always work and you don't have to worry about them.