Why does '/' contain '..'?Why does '/' have an '..' entry?Why is iwconfig in /sbin?Why the unix bin directory named in that way?Why can I only run a .sh file from the parent directory, not the child directoryWhat filesystem mount point am I currently working on?How to find directories whose size is greater than 4K?What is the reasoning/design choice behind the unix/linux file system structure?Standard environment variables for distribution-specific pathsWhy is /bin a symbolic link to /usr/bin?The content of directory /dev/fd have difference file in one time

What 68-pin connector is this on my 2.5" solid state drive?

Does a feasible high thrust high specific impulse engine exist using current non space technology?

Why don't Wizards use wrist straps to protect against disarming charms?

Why is it called a stateful and a stateless firewall?

Is my sink P-trap too low?

Planar regular languages

Does a large scratch in an ND filter affect image quality?

Seven Places at Once - Another Google Earth Challenge?

What are the typical trumpet parts in classical music?

Why does Kubuntu 19.04 show an update that apparently doesn't exist?

Exam design: give maximum score per question or not?

What are the advantages and disadvantages of tail wheels that cause modern airplanes to not use them?

Ethernet, Wifi and a little human psychology

Teleport everything in a large zone; or teleport all living things and make a lot of equipment disappear

Insight into cavity resonators

Amortized Loans seem to benefit the bank more than the customer

How to create an animated flowchart with LaTeX?

Pronunciation of "солнце"

Can Brexit be undone in an emergency?

Impossible Scrabble Words

geschafft or geschaffen? which one is past participle of schaffen?

How clean are pets?

Calculate the limit without l'Hopital rule

Has Dumbledore ever scolded Harry?



Why does '/' contain '..'?


Why does '/' have an '..' entry?Why is iwconfig in /sbin?Why the unix bin directory named in that way?Why can I only run a .sh file from the parent directory, not the child directoryWhat filesystem mount point am I currently working on?How to find directories whose size is greater than 4K?What is the reasoning/design choice behind the unix/linux file system structure?Standard environment variables for distribution-specific pathsWhy is /bin a symbolic link to /usr/bin?The content of directory /dev/fd have difference file in one time






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








5















There's no directory above /, so what's the point of the .. in it?










share|improve this question



















  • 1





    How do you know there's nothing above it? You may be in a chroot. Should the .. entry need to be created if you mount your root directory someplace else (like on another machine)?

    – Kusalananda
    9 hours ago












  • Not sure this is correct but it seems like it would be more work to omit it than it would be to just apply to all directories without prejudice.

    – Jesse_b
    9 hours ago












  • @Kusalananda cd .. in a root dir of chroot won't get you out of the chroot, nor will it fail with an error.

    – mosvy
    8 hours ago






  • 1





    I look at it this way: consistency with the rest of the filesystem and stopping point for iterative traversal up the tree. When the parent node in a tree points to itself, you know you've reached the root of the tree.

    – Sergiy Kolodyazhnyy
    8 hours ago

















5















There's no directory above /, so what's the point of the .. in it?










share|improve this question



















  • 1





    How do you know there's nothing above it? You may be in a chroot. Should the .. entry need to be created if you mount your root directory someplace else (like on another machine)?

    – Kusalananda
    9 hours ago












  • Not sure this is correct but it seems like it would be more work to omit it than it would be to just apply to all directories without prejudice.

    – Jesse_b
    9 hours ago












  • @Kusalananda cd .. in a root dir of chroot won't get you out of the chroot, nor will it fail with an error.

    – mosvy
    8 hours ago






  • 1





    I look at it this way: consistency with the rest of the filesystem and stopping point for iterative traversal up the tree. When the parent node in a tree points to itself, you know you've reached the root of the tree.

    – Sergiy Kolodyazhnyy
    8 hours ago













5












5








5








There's no directory above /, so what's the point of the .. in it?










share|improve this question














There's no directory above /, so what's the point of the .. in it?







filesystems directory-structure






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 9 hours ago









EmmaVEmmaV

1,3421 gold badge13 silver badges38 bronze badges




1,3421 gold badge13 silver badges38 bronze badges










  • 1





    How do you know there's nothing above it? You may be in a chroot. Should the .. entry need to be created if you mount your root directory someplace else (like on another machine)?

    – Kusalananda
    9 hours ago












  • Not sure this is correct but it seems like it would be more work to omit it than it would be to just apply to all directories without prejudice.

    – Jesse_b
    9 hours ago












  • @Kusalananda cd .. in a root dir of chroot won't get you out of the chroot, nor will it fail with an error.

    – mosvy
    8 hours ago






  • 1





    I look at it this way: consistency with the rest of the filesystem and stopping point for iterative traversal up the tree. When the parent node in a tree points to itself, you know you've reached the root of the tree.

    – Sergiy Kolodyazhnyy
    8 hours ago












  • 1





    How do you know there's nothing above it? You may be in a chroot. Should the .. entry need to be created if you mount your root directory someplace else (like on another machine)?

    – Kusalananda
    9 hours ago












  • Not sure this is correct but it seems like it would be more work to omit it than it would be to just apply to all directories without prejudice.

    – Jesse_b
    9 hours ago












  • @Kusalananda cd .. in a root dir of chroot won't get you out of the chroot, nor will it fail with an error.

    – mosvy
    8 hours ago






  • 1





    I look at it this way: consistency with the rest of the filesystem and stopping point for iterative traversal up the tree. When the parent node in a tree points to itself, you know you've reached the root of the tree.

    – Sergiy Kolodyazhnyy
    8 hours ago







1




1





How do you know there's nothing above it? You may be in a chroot. Should the .. entry need to be created if you mount your root directory someplace else (like on another machine)?

– Kusalananda
9 hours ago






How do you know there's nothing above it? You may be in a chroot. Should the .. entry need to be created if you mount your root directory someplace else (like on another machine)?

– Kusalananda
9 hours ago














Not sure this is correct but it seems like it would be more work to omit it than it would be to just apply to all directories without prejudice.

– Jesse_b
9 hours ago






Not sure this is correct but it seems like it would be more work to omit it than it would be to just apply to all directories without prejudice.

– Jesse_b
9 hours ago














@Kusalananda cd .. in a root dir of chroot won't get you out of the chroot, nor will it fail with an error.

– mosvy
8 hours ago





@Kusalananda cd .. in a root dir of chroot won't get you out of the chroot, nor will it fail with an error.

– mosvy
8 hours ago




1




1





I look at it this way: consistency with the rest of the filesystem and stopping point for iterative traversal up the tree. When the parent node in a tree points to itself, you know you've reached the root of the tree.

– Sergiy Kolodyazhnyy
8 hours ago





I look at it this way: consistency with the rest of the filesystem and stopping point for iterative traversal up the tree. When the parent node in a tree points to itself, you know you've reached the root of the tree.

– Sergiy Kolodyazhnyy
8 hours ago










2 Answers
2






active

oldest

votes


















5
















The .. entry in the root directory is a special case.



From the POSIX standard (4.13 Pathname Resolution):




The special filename dot shall refer to the directory specified by its predecessor. The special filename dot-dot shall refer to the parent directory of its predecessor directory. As a special case, in the root directory, dot-dot may refer to the root directory itself.




The rationale has this to add (A.4.13 Pathname Resolution)




What the filename dot-dot refers to relative to the root directory is implementation-defined. In Version 7 it refers to the root directory itself; this is the behavior mentioned in POSIX.1-2017. In some networked systems the construction /../hostname/ is used to refer to the root directory of another host, and POSIX.1 permits this behavior.



Other networked systems use the construct //hostname for the same purpose; that is, a double initial <slash> is used. [...]




So, in short, the POSIX standard says that every directory should have both . and .. entries, and permits the .. directory entry in / to refer to the / directory itself (notice the word "may" in the first text quoted), but it also allows an implementation to let it refer to something else.



Most common implementations of filesystems makes /.. resolve to /.






share|improve this answer



























  • In other words, POSIX says "A POSIX compliant system must have /.. but it's up to you what you want to do with it"

    – Sergiy Kolodyazhnyy
    8 hours ago











  • @SergiyKolodyazhnyy Pretty much, yes, if by "you" you mean someone implementing the standard.

    – Kusalananda
    8 hours ago


















0
















There is a directory above /, / itself. The parent directory of the root directory is itself. cd .. or cd ../.. inside the root directory should leave you at the same place, not cause an error.



Notice that neither . or .. may exist as actual directory entries in some filesystems, they may be simply emulated by the virtual file system layer of the OS.






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',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    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%2f541779%2fwhy-does-contain%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    5
















    The .. entry in the root directory is a special case.



    From the POSIX standard (4.13 Pathname Resolution):




    The special filename dot shall refer to the directory specified by its predecessor. The special filename dot-dot shall refer to the parent directory of its predecessor directory. As a special case, in the root directory, dot-dot may refer to the root directory itself.




    The rationale has this to add (A.4.13 Pathname Resolution)




    What the filename dot-dot refers to relative to the root directory is implementation-defined. In Version 7 it refers to the root directory itself; this is the behavior mentioned in POSIX.1-2017. In some networked systems the construction /../hostname/ is used to refer to the root directory of another host, and POSIX.1 permits this behavior.



    Other networked systems use the construct //hostname for the same purpose; that is, a double initial <slash> is used. [...]




    So, in short, the POSIX standard says that every directory should have both . and .. entries, and permits the .. directory entry in / to refer to the / directory itself (notice the word "may" in the first text quoted), but it also allows an implementation to let it refer to something else.



    Most common implementations of filesystems makes /.. resolve to /.






    share|improve this answer



























    • In other words, POSIX says "A POSIX compliant system must have /.. but it's up to you what you want to do with it"

      – Sergiy Kolodyazhnyy
      8 hours ago











    • @SergiyKolodyazhnyy Pretty much, yes, if by "you" you mean someone implementing the standard.

      – Kusalananda
      8 hours ago















    5
















    The .. entry in the root directory is a special case.



    From the POSIX standard (4.13 Pathname Resolution):




    The special filename dot shall refer to the directory specified by its predecessor. The special filename dot-dot shall refer to the parent directory of its predecessor directory. As a special case, in the root directory, dot-dot may refer to the root directory itself.




    The rationale has this to add (A.4.13 Pathname Resolution)




    What the filename dot-dot refers to relative to the root directory is implementation-defined. In Version 7 it refers to the root directory itself; this is the behavior mentioned in POSIX.1-2017. In some networked systems the construction /../hostname/ is used to refer to the root directory of another host, and POSIX.1 permits this behavior.



    Other networked systems use the construct //hostname for the same purpose; that is, a double initial <slash> is used. [...]




    So, in short, the POSIX standard says that every directory should have both . and .. entries, and permits the .. directory entry in / to refer to the / directory itself (notice the word "may" in the first text quoted), but it also allows an implementation to let it refer to something else.



    Most common implementations of filesystems makes /.. resolve to /.






    share|improve this answer



























    • In other words, POSIX says "A POSIX compliant system must have /.. but it's up to you what you want to do with it"

      – Sergiy Kolodyazhnyy
      8 hours ago











    • @SergiyKolodyazhnyy Pretty much, yes, if by "you" you mean someone implementing the standard.

      – Kusalananda
      8 hours ago













    5














    5










    5









    The .. entry in the root directory is a special case.



    From the POSIX standard (4.13 Pathname Resolution):




    The special filename dot shall refer to the directory specified by its predecessor. The special filename dot-dot shall refer to the parent directory of its predecessor directory. As a special case, in the root directory, dot-dot may refer to the root directory itself.




    The rationale has this to add (A.4.13 Pathname Resolution)




    What the filename dot-dot refers to relative to the root directory is implementation-defined. In Version 7 it refers to the root directory itself; this is the behavior mentioned in POSIX.1-2017. In some networked systems the construction /../hostname/ is used to refer to the root directory of another host, and POSIX.1 permits this behavior.



    Other networked systems use the construct //hostname for the same purpose; that is, a double initial <slash> is used. [...]




    So, in short, the POSIX standard says that every directory should have both . and .. entries, and permits the .. directory entry in / to refer to the / directory itself (notice the word "may" in the first text quoted), but it also allows an implementation to let it refer to something else.



    Most common implementations of filesystems makes /.. resolve to /.






    share|improve this answer















    The .. entry in the root directory is a special case.



    From the POSIX standard (4.13 Pathname Resolution):




    The special filename dot shall refer to the directory specified by its predecessor. The special filename dot-dot shall refer to the parent directory of its predecessor directory. As a special case, in the root directory, dot-dot may refer to the root directory itself.




    The rationale has this to add (A.4.13 Pathname Resolution)




    What the filename dot-dot refers to relative to the root directory is implementation-defined. In Version 7 it refers to the root directory itself; this is the behavior mentioned in POSIX.1-2017. In some networked systems the construction /../hostname/ is used to refer to the root directory of another host, and POSIX.1 permits this behavior.



    Other networked systems use the construct //hostname for the same purpose; that is, a double initial <slash> is used. [...]




    So, in short, the POSIX standard says that every directory should have both . and .. entries, and permits the .. directory entry in / to refer to the / directory itself (notice the word "may" in the first text quoted), but it also allows an implementation to let it refer to something else.



    Most common implementations of filesystems makes /.. resolve to /.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited 7 hours ago

























    answered 8 hours ago









    KusalanandaKusalananda

    164k19 gold badges321 silver badges509 bronze badges




    164k19 gold badges321 silver badges509 bronze badges















    • In other words, POSIX says "A POSIX compliant system must have /.. but it's up to you what you want to do with it"

      – Sergiy Kolodyazhnyy
      8 hours ago











    • @SergiyKolodyazhnyy Pretty much, yes, if by "you" you mean someone implementing the standard.

      – Kusalananda
      8 hours ago

















    • In other words, POSIX says "A POSIX compliant system must have /.. but it's up to you what you want to do with it"

      – Sergiy Kolodyazhnyy
      8 hours ago











    • @SergiyKolodyazhnyy Pretty much, yes, if by "you" you mean someone implementing the standard.

      – Kusalananda
      8 hours ago
















    In other words, POSIX says "A POSIX compliant system must have /.. but it's up to you what you want to do with it"

    – Sergiy Kolodyazhnyy
    8 hours ago





    In other words, POSIX says "A POSIX compliant system must have /.. but it's up to you what you want to do with it"

    – Sergiy Kolodyazhnyy
    8 hours ago













    @SergiyKolodyazhnyy Pretty much, yes, if by "you" you mean someone implementing the standard.

    – Kusalananda
    8 hours ago





    @SergiyKolodyazhnyy Pretty much, yes, if by "you" you mean someone implementing the standard.

    – Kusalananda
    8 hours ago













    0
















    There is a directory above /, / itself. The parent directory of the root directory is itself. cd .. or cd ../.. inside the root directory should leave you at the same place, not cause an error.



    Notice that neither . or .. may exist as actual directory entries in some filesystems, they may be simply emulated by the virtual file system layer of the OS.






    share|improve this answer































      0
















      There is a directory above /, / itself. The parent directory of the root directory is itself. cd .. or cd ../.. inside the root directory should leave you at the same place, not cause an error.



      Notice that neither . or .. may exist as actual directory entries in some filesystems, they may be simply emulated by the virtual file system layer of the OS.






      share|improve this answer





























        0














        0










        0









        There is a directory above /, / itself. The parent directory of the root directory is itself. cd .. or cd ../.. inside the root directory should leave you at the same place, not cause an error.



        Notice that neither . or .. may exist as actual directory entries in some filesystems, they may be simply emulated by the virtual file system layer of the OS.






        share|improve this answer















        There is a directory above /, / itself. The parent directory of the root directory is itself. cd .. or cd ../.. inside the root directory should leave you at the same place, not cause an error.



        Notice that neither . or .. may exist as actual directory entries in some filesystems, they may be simply emulated by the virtual file system layer of the OS.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 8 hours ago

























        answered 8 hours ago









        mosvymosvy

        17.3k2 gold badges23 silver badges54 bronze badges




        17.3k2 gold badges23 silver badges54 bronze badges































            draft saved

            draft discarded















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f541779%2fwhy-does-contain%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            ParseJSON using SSJSUsing AMPscript with SSJS ActivitiesHow to resubscribe a user in Marketing cloud using SSJS?Pulling Subscriber Status from Lists using SSJSRetrieving Emails using SSJSProblem in updating DE using SSJSUsing SSJS to send single email in Marketing CloudError adding EmailSendDefinition using SSJS

            Кампала Садржај Географија Географија Историја Становништво Привреда Партнерски градови Референце Спољашње везе Мени за навигацију0°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.340°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.34МедијиПодациЗванични веб-сајту

            19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу