I was troubleshooting a problem with a guy on irc and he suggested me to run this command. What I do not understand is what the two points mean,
ln -s ../run/lock /var/lock
I was troubleshooting a problem with a guy on irc and he suggested me to run this command. What I do not understand is what the two points mean,
ln -s ../run/lock /var/lock
If you mean the two dots, it is the bash way to say go up a directory before diving down in run
etc.
It means,
if your folder named "run" is inside another folder, this ../
will take you to the higher folder and navigate to a file outside the directory you're currently in. For example (see the folder structure below):
project_folder/
├─ modules/
│ ├─ main.py
├─ run/
│ ├─ lock/
│ │ ├─ var/
│ │ │ ├─ lock/
your code is written in the main.py
file under the modules
folder. To navigate to the ``run/lock/var/lock```` you have to go up one folder to do that, this is why you need to add ../
before the path you want to go to. You can add more ../../
if you want to go up further.
The ../run
means to take the run
directory from the current' parent directory. If your script is running from foo/bar/
it should then look for lock command in foo/run/
There are really nice and informative content arround internet about terminals in general, here is a citation of a really good article about the use of terminal in linux:
Usually, we use names to access the directories. In Linux we use symbols.
.
This directory.
..
The parent directory.
/
Directory separator. Directories end in a forward slash and this is oftenassumed the directory separator is optional i.e.
$ cd /bin/abc
$ cd /bin/abc/
are same.