Help interpreting this command

The name of the pictureThe name of the pictureThe name of the pictureClash 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?







share|improve this question






















  • It's an S. Much like the one at the end of my previous sentence.
    – Ignacio Vazquez-Abrams
    Feb 19 at 1:13














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?







share|improve this question






















  • It's an S. Much like the one at the end of my previous sentence.
    – Ignacio Vazquez-Abrams
    Feb 19 at 1:13












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?







share|improve this question














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?









share|improve this question













share|improve this question




share|improve this question








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
















  • 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










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.






share|improve this answer




















  • 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

















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






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    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






























    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.






    share|improve this answer




















    • 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














    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.






    share|improve this answer




















    • 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












    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.






    share|improve this answer












    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.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    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
















    • 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












    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






    share|improve this answer
























      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






      share|improve this answer






















        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






        share|improve this answer












        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







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 19 at 8:10









        Pedro

        59429




        59429






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            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













































































            Popular posts from this blog

            Peggy Mitchell

            Palaiologos

            The Forum (Inglewood, California)