Help interpreting this command

Clash Royale CLAN TAG#URR8PPP
up vote
-1
down vote
favorite
I'm a student and we are about to start our DB course in college, a few days ago in one documents the professor gave us I found the following command:
for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done
As far as understand this command is going to create a symbolic link between each file using the for cycle, but what I can't really understand is the S in that numeration, what is it supposed to do?
linux command-line symlink
add a comment |Â
up vote
-1
down vote
favorite
I'm a student and we are about to start our DB course in college, a few days ago in one documents the professor gave us I found the following command:
for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done
As far as understand this command is going to create a symbolic link between each file using the for cycle, but what I can't really understand is the S in that numeration, what is it supposed to do?
linux command-line symlink
It's an S. Much like the one at the end of my previous sentence.
â Ignacio Vazquez-Abrams
Feb 19 at 1:13
add a comment |Â
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I'm a student and we are about to start our DB course in college, a few days ago in one documents the professor gave us I found the following command:
for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done
As far as understand this command is going to create a symbolic link between each file using the for cycle, but what I can't really understand is the S in that numeration, what is it supposed to do?
linux command-line symlink
I'm a student and we are about to start our DB course in college, a few days ago in one documents the professor gave us I found the following command:
for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done
As far as understand this command is going to create a symbolic link between each file using the for cycle, but what I can't really understand is the S in that numeration, what is it supposed to do?
linux command-line symlink
edited Feb 19 at 1:30
Jeff Schaller
31.2k846105
31.2k846105
asked Feb 19 at 1:07
spurdosparde
11
11
It's an S. Much like the one at the end of my previous sentence.
â Ignacio Vazquez-Abrams
Feb 19 at 1:13
add a comment |Â
It's an S. Much like the one at the end of my previous sentence.
â Ignacio Vazquez-Abrams
Feb 19 at 1:13
It's an S. Much like the one at the end of my previous sentence.
â Ignacio Vazquez-Abrams
Feb 19 at 1:13
It's an S. Much like the one at the end of my previous sentence.
â Ignacio Vazquez-Abrams
Feb 19 at 1:13
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
Those numbers aren't randomly selected, they're the runlevels of your system. The runlevel used to determine which init scripts are run. They're mostly obsolete now. And if you're on Linux, it's highly likely that the runlevels S and 1 are the same. Your documents might be really old, or they'd probably be using update-rc.d instead of manually creating symlinks.
So your loop is iterating over all runlevels, 1-6 and S.
Okay, so if I understand correctly this is creating a symlink to the each of the initialization scripts? Now this really makes sense, thank you.
â spurdosparde
Feb 19 at 1:26
@spurdosparde yes. But if you're on popular Linux distros like Ubuntu, Debian, Fedora, CentOS, this is just supported for backwards compatibility, so there's not much to be gained from digging too much into it.
â Olorin
Feb 19 at 1:29
add a comment |Â
up vote
0
down vote
All items after the 'in' in the for loop are strings that will be assigned to $i in the loop. The script will create soft links from /etc/rc?.d into /etc/rc.d/rc?.d. This is probably a bit of a hack to ensure some sort of compatibility between distros.
S is sometimes used as a synonym to runlevel 1 or single-user mode. https://en.wikipedia.org/wiki/Runlevel
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Those numbers aren't randomly selected, they're the runlevels of your system. The runlevel used to determine which init scripts are run. They're mostly obsolete now. And if you're on Linux, it's highly likely that the runlevels S and 1 are the same. Your documents might be really old, or they'd probably be using update-rc.d instead of manually creating symlinks.
So your loop is iterating over all runlevels, 1-6 and S.
Okay, so if I understand correctly this is creating a symlink to the each of the initialization scripts? Now this really makes sense, thank you.
â spurdosparde
Feb 19 at 1:26
@spurdosparde yes. But if you're on popular Linux distros like Ubuntu, Debian, Fedora, CentOS, this is just supported for backwards compatibility, so there's not much to be gained from digging too much into it.
â Olorin
Feb 19 at 1:29
add a comment |Â
up vote
1
down vote
accepted
Those numbers aren't randomly selected, they're the runlevels of your system. The runlevel used to determine which init scripts are run. They're mostly obsolete now. And if you're on Linux, it's highly likely that the runlevels S and 1 are the same. Your documents might be really old, or they'd probably be using update-rc.d instead of manually creating symlinks.
So your loop is iterating over all runlevels, 1-6 and S.
Okay, so if I understand correctly this is creating a symlink to the each of the initialization scripts? Now this really makes sense, thank you.
â spurdosparde
Feb 19 at 1:26
@spurdosparde yes. But if you're on popular Linux distros like Ubuntu, Debian, Fedora, CentOS, this is just supported for backwards compatibility, so there's not much to be gained from digging too much into it.
â Olorin
Feb 19 at 1:29
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Those numbers aren't randomly selected, they're the runlevels of your system. The runlevel used to determine which init scripts are run. They're mostly obsolete now. And if you're on Linux, it's highly likely that the runlevels S and 1 are the same. Your documents might be really old, or they'd probably be using update-rc.d instead of manually creating symlinks.
So your loop is iterating over all runlevels, 1-6 and S.
Those numbers aren't randomly selected, they're the runlevels of your system. The runlevel used to determine which init scripts are run. They're mostly obsolete now. And if you're on Linux, it's highly likely that the runlevels S and 1 are the same. Your documents might be really old, or they'd probably be using update-rc.d instead of manually creating symlinks.
So your loop is iterating over all runlevels, 1-6 and S.
answered Feb 19 at 1:17
Olorin
1,15711
1,15711
Okay, so if I understand correctly this is creating a symlink to the each of the initialization scripts? Now this really makes sense, thank you.
â spurdosparde
Feb 19 at 1:26
@spurdosparde yes. But if you're on popular Linux distros like Ubuntu, Debian, Fedora, CentOS, this is just supported for backwards compatibility, so there's not much to be gained from digging too much into it.
â Olorin
Feb 19 at 1:29
add a comment |Â
Okay, so if I understand correctly this is creating a symlink to the each of the initialization scripts? Now this really makes sense, thank you.
â spurdosparde
Feb 19 at 1:26
@spurdosparde yes. But if you're on popular Linux distros like Ubuntu, Debian, Fedora, CentOS, this is just supported for backwards compatibility, so there's not much to be gained from digging too much into it.
â Olorin
Feb 19 at 1:29
Okay, so if I understand correctly this is creating a symlink to the each of the initialization scripts? Now this really makes sense, thank you.
â spurdosparde
Feb 19 at 1:26
Okay, so if I understand correctly this is creating a symlink to the each of the initialization scripts? Now this really makes sense, thank you.
â spurdosparde
Feb 19 at 1:26
@spurdosparde yes. But if you're on popular Linux distros like Ubuntu, Debian, Fedora, CentOS, this is just supported for backwards compatibility, so there's not much to be gained from digging too much into it.
â Olorin
Feb 19 at 1:29
@spurdosparde yes. But if you're on popular Linux distros like Ubuntu, Debian, Fedora, CentOS, this is just supported for backwards compatibility, so there's not much to be gained from digging too much into it.
â Olorin
Feb 19 at 1:29
add a comment |Â
up vote
0
down vote
All items after the 'in' in the for loop are strings that will be assigned to $i in the loop. The script will create soft links from /etc/rc?.d into /etc/rc.d/rc?.d. This is probably a bit of a hack to ensure some sort of compatibility between distros.
S is sometimes used as a synonym to runlevel 1 or single-user mode. https://en.wikipedia.org/wiki/Runlevel
add a comment |Â
up vote
0
down vote
All items after the 'in' in the for loop are strings that will be assigned to $i in the loop. The script will create soft links from /etc/rc?.d into /etc/rc.d/rc?.d. This is probably a bit of a hack to ensure some sort of compatibility between distros.
S is sometimes used as a synonym to runlevel 1 or single-user mode. https://en.wikipedia.org/wiki/Runlevel
add a comment |Â
up vote
0
down vote
up vote
0
down vote
All items after the 'in' in the for loop are strings that will be assigned to $i in the loop. The script will create soft links from /etc/rc?.d into /etc/rc.d/rc?.d. This is probably a bit of a hack to ensure some sort of compatibility between distros.
S is sometimes used as a synonym to runlevel 1 or single-user mode. https://en.wikipedia.org/wiki/Runlevel
All items after the 'in' in the for loop are strings that will be assigned to $i in the loop. The script will create soft links from /etc/rc?.d into /etc/rc.d/rc?.d. This is probably a bit of a hack to ensure some sort of compatibility between distros.
S is sometimes used as a synonym to runlevel 1 or single-user mode. https://en.wikipedia.org/wiki/Runlevel
answered Feb 19 at 8:10
Pedro
59429
59429
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f425053%2fhelp-interpreting-this-command%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
It's an S. Much like the one at the end of my previous sentence.
â Ignacio Vazquez-Abrams
Feb 19 at 1:13