In the examples you gave:
1. /dir/dir/ 2. /dir/dir 3. dir/dir/ 4. dir/dir
Numbers 1 and 2 are absolute paths, meaning that they start at (ie. "are anchored at") the root directory "/".
Numbers 3 and 4 and relative paths, meaning that there location depends on which directory you are in when you refer to them. For example, if you are in the absolute directory "/var/www/html", and you refer to "css/styles", you are accessing the absolute directory "/var/www/html/css/styles".
But if you started in the directory "/var/www/cgi", then referring to "css/styles" would mean an absolute path of "/var/www/cgi/css/styles" instead.
Other than that, "/dir/dir/" and "/dir/dir" are nearly always identical. There are a few places where they behave in subtly different ways (eg. if "/dir/dir" is a symbolic link), but they are not anything you need to worry about at this stage in your learning curve.
In reply to Re: Path strings
by liverpole
in thread Path strings
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |