What's so special about directories whose names begin with a dot?












22














I was wondering what the difference between these two were:



~/somedirectory/file.txt


and



~/.somedirectory/file.txt


It's really difficult to ask this on Google since I didn't know how to explain the . when I didn't even know what to call it. But can someone describe the difference between including the dot and excluding it?










share|improve this question















migrated from programmers.stackexchange.com Sep 30 '11 at 15:15


This question came from our site for professionals, academics, and students working within the systems development life cycle.




















    22














    I was wondering what the difference between these two were:



    ~/somedirectory/file.txt


    and



    ~/.somedirectory/file.txt


    It's really difficult to ask this on Google since I didn't know how to explain the . when I didn't even know what to call it. But can someone describe the difference between including the dot and excluding it?










    share|improve this question















    migrated from programmers.stackexchange.com Sep 30 '11 at 15:15


    This question came from our site for professionals, academics, and students working within the systems development life cycle.


















      22












      22








      22


      5





      I was wondering what the difference between these two were:



      ~/somedirectory/file.txt


      and



      ~/.somedirectory/file.txt


      It's really difficult to ask this on Google since I didn't know how to explain the . when I didn't even know what to call it. But can someone describe the difference between including the dot and excluding it?










      share|improve this question















      I was wondering what the difference between these two were:



      ~/somedirectory/file.txt


      and



      ~/.somedirectory/file.txt


      It's really difficult to ask this on Google since I didn't know how to explain the . when I didn't even know what to call it. But can someone describe the difference between including the dot and excluding it?







      files directory-structure dot-files






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 2 '11 at 0:55









      Gilles

      530k12810621589




      530k12810621589










      asked Sep 30 '11 at 14:55









      Dark TemplarDark Templar

      275127




      275127




      migrated from programmers.stackexchange.com Sep 30 '11 at 15:15


      This question came from our site for professionals, academics, and students working within the systems development life cycle.






      migrated from programmers.stackexchange.com Sep 30 '11 at 15:15


      This question came from our site for professionals, academics, and students working within the systems development life cycle.
























          5 Answers
          5






          active

          oldest

          votes


















          16














          Under unix-like systems, all directories contain two entries, . and .., which stand for the directory itself and its parent respectively. These entries are not interesting most of the time, so ls hides them, and shell wildcards like * don't include them. More generally, ls and wildcards hide all files whose name begins with a .; this is a simple way to exclude . and .. and allow users to hide other files from listings. Other than being excluded from listings, there's nothing special about these files.



          Unix stores per-user configuration files in the user's home directory. If all configuration files appeared in file listings, the home directory would be cluttered with files that users don't care about every day. So configuration files always begin with a .: typically, the configuration file for the application Foo is called something like .foo or .foorc. For this reason, user configuration files are often known as dot files.






          share|improve this answer



















          • 1




            "More generally, ls and wildcards hide all files whose name begins with a .; this is a simple way to exclude . and .. and allow users to hide other files from listings." This sounds like the following: The concept of hiding files/directories that start with a dot has actually appeared to hide . ... But later, people realized that being able to hide some files/directories has a value in it and hence, they began to put a dot at the beginning of the files which they want to be hidden. Is that really the case or just a speculation?
            – Utku
            Oct 5 '15 at 14:17






          • 3




            @Utku Actually, it was the other way round, as least at first: the original developer intended to hide only . and .. but made a mistake. It's however possible that he was dissuaded from fixing it because some users found it useful, and the reason why user configuration files start with . is definitely so that they don't clutter the output of ls in the home directory. I think we have a question about this here but I can't find it, it may have been mistagged.
            – Gilles
            Oct 5 '15 at 18:49



















          15














          Directorys starting with a dot . are considered to be hidden. That means:




          • ~/somedirectory and ~/.somedirectory are different directories. That is if ~/somedirectory existed and you did mkdir ~/.somedirectory, you won't fail with a File Exists message.


          • The ls command will not show those directories starting with the .


          • The ls -a will show both directories







          share|improve this answer



















          • 5




            ls -A displays files and directories that start with . but doesn't include the . and .. entries.
            – Julian
            Sep 30 '11 at 15:47



















          7














          For details on the Unix file system check the standard. Specifically, dot files are used for configuration files in a users directory, and if a program has more than one, it should put them into a dot directory.



          This hides the files from the user, unless they want to find them. That way they don't get in the way, and tools don't go messing with them accidentally.






          share|improve this answer





























            4














            The leading "." in a directory or file name causes that directory or file to be hidden when doing a ls command.






            share|improve this answer

















            • 1




              You can view all files starting with "." with ls -a.
              – Sardathrion
              Sep 30 '11 at 15:06



















            1














            Like @DaveNay already said, that period will cause the file or directory to be hidden.



            For your second implicit question, this is how you search for that in google:



            Just type in the search box: linux period before name






            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/3.0/"u003ecc by-sa 3.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%2f21778%2fwhats-so-special-about-directories-whose-names-begin-with-a-dot%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              5 Answers
              5






              active

              oldest

              votes








              5 Answers
              5






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              16














              Under unix-like systems, all directories contain two entries, . and .., which stand for the directory itself and its parent respectively. These entries are not interesting most of the time, so ls hides them, and shell wildcards like * don't include them. More generally, ls and wildcards hide all files whose name begins with a .; this is a simple way to exclude . and .. and allow users to hide other files from listings. Other than being excluded from listings, there's nothing special about these files.



              Unix stores per-user configuration files in the user's home directory. If all configuration files appeared in file listings, the home directory would be cluttered with files that users don't care about every day. So configuration files always begin with a .: typically, the configuration file for the application Foo is called something like .foo or .foorc. For this reason, user configuration files are often known as dot files.






              share|improve this answer



















              • 1




                "More generally, ls and wildcards hide all files whose name begins with a .; this is a simple way to exclude . and .. and allow users to hide other files from listings." This sounds like the following: The concept of hiding files/directories that start with a dot has actually appeared to hide . ... But later, people realized that being able to hide some files/directories has a value in it and hence, they began to put a dot at the beginning of the files which they want to be hidden. Is that really the case or just a speculation?
                – Utku
                Oct 5 '15 at 14:17






              • 3




                @Utku Actually, it was the other way round, as least at first: the original developer intended to hide only . and .. but made a mistake. It's however possible that he was dissuaded from fixing it because some users found it useful, and the reason why user configuration files start with . is definitely so that they don't clutter the output of ls in the home directory. I think we have a question about this here but I can't find it, it may have been mistagged.
                – Gilles
                Oct 5 '15 at 18:49
















              16














              Under unix-like systems, all directories contain two entries, . and .., which stand for the directory itself and its parent respectively. These entries are not interesting most of the time, so ls hides them, and shell wildcards like * don't include them. More generally, ls and wildcards hide all files whose name begins with a .; this is a simple way to exclude . and .. and allow users to hide other files from listings. Other than being excluded from listings, there's nothing special about these files.



              Unix stores per-user configuration files in the user's home directory. If all configuration files appeared in file listings, the home directory would be cluttered with files that users don't care about every day. So configuration files always begin with a .: typically, the configuration file for the application Foo is called something like .foo or .foorc. For this reason, user configuration files are often known as dot files.






              share|improve this answer



















              • 1




                "More generally, ls and wildcards hide all files whose name begins with a .; this is a simple way to exclude . and .. and allow users to hide other files from listings." This sounds like the following: The concept of hiding files/directories that start with a dot has actually appeared to hide . ... But later, people realized that being able to hide some files/directories has a value in it and hence, they began to put a dot at the beginning of the files which they want to be hidden. Is that really the case or just a speculation?
                – Utku
                Oct 5 '15 at 14:17






              • 3




                @Utku Actually, it was the other way round, as least at first: the original developer intended to hide only . and .. but made a mistake. It's however possible that he was dissuaded from fixing it because some users found it useful, and the reason why user configuration files start with . is definitely so that they don't clutter the output of ls in the home directory. I think we have a question about this here but I can't find it, it may have been mistagged.
                – Gilles
                Oct 5 '15 at 18:49














              16












              16








              16






              Under unix-like systems, all directories contain two entries, . and .., which stand for the directory itself and its parent respectively. These entries are not interesting most of the time, so ls hides them, and shell wildcards like * don't include them. More generally, ls and wildcards hide all files whose name begins with a .; this is a simple way to exclude . and .. and allow users to hide other files from listings. Other than being excluded from listings, there's nothing special about these files.



              Unix stores per-user configuration files in the user's home directory. If all configuration files appeared in file listings, the home directory would be cluttered with files that users don't care about every day. So configuration files always begin with a .: typically, the configuration file for the application Foo is called something like .foo or .foorc. For this reason, user configuration files are often known as dot files.






              share|improve this answer














              Under unix-like systems, all directories contain two entries, . and .., which stand for the directory itself and its parent respectively. These entries are not interesting most of the time, so ls hides them, and shell wildcards like * don't include them. More generally, ls and wildcards hide all files whose name begins with a .; this is a simple way to exclude . and .. and allow users to hide other files from listings. Other than being excluded from listings, there's nothing special about these files.



              Unix stores per-user configuration files in the user's home directory. If all configuration files appeared in file listings, the home directory would be cluttered with files that users don't care about every day. So configuration files always begin with a .: typically, the configuration file for the application Foo is called something like .foo or .foorc. For this reason, user configuration files are often known as dot files.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Apr 13 '17 at 12:36









              Community

              1




              1










              answered Oct 2 '11 at 0:54









              GillesGilles

              530k12810621589




              530k12810621589








              • 1




                "More generally, ls and wildcards hide all files whose name begins with a .; this is a simple way to exclude . and .. and allow users to hide other files from listings." This sounds like the following: The concept of hiding files/directories that start with a dot has actually appeared to hide . ... But later, people realized that being able to hide some files/directories has a value in it and hence, they began to put a dot at the beginning of the files which they want to be hidden. Is that really the case or just a speculation?
                – Utku
                Oct 5 '15 at 14:17






              • 3




                @Utku Actually, it was the other way round, as least at first: the original developer intended to hide only . and .. but made a mistake. It's however possible that he was dissuaded from fixing it because some users found it useful, and the reason why user configuration files start with . is definitely so that they don't clutter the output of ls in the home directory. I think we have a question about this here but I can't find it, it may have been mistagged.
                – Gilles
                Oct 5 '15 at 18:49














              • 1




                "More generally, ls and wildcards hide all files whose name begins with a .; this is a simple way to exclude . and .. and allow users to hide other files from listings." This sounds like the following: The concept of hiding files/directories that start with a dot has actually appeared to hide . ... But later, people realized that being able to hide some files/directories has a value in it and hence, they began to put a dot at the beginning of the files which they want to be hidden. Is that really the case or just a speculation?
                – Utku
                Oct 5 '15 at 14:17






              • 3




                @Utku Actually, it was the other way round, as least at first: the original developer intended to hide only . and .. but made a mistake. It's however possible that he was dissuaded from fixing it because some users found it useful, and the reason why user configuration files start with . is definitely so that they don't clutter the output of ls in the home directory. I think we have a question about this here but I can't find it, it may have been mistagged.
                – Gilles
                Oct 5 '15 at 18:49








              1




              1




              "More generally, ls and wildcards hide all files whose name begins with a .; this is a simple way to exclude . and .. and allow users to hide other files from listings." This sounds like the following: The concept of hiding files/directories that start with a dot has actually appeared to hide . ... But later, people realized that being able to hide some files/directories has a value in it and hence, they began to put a dot at the beginning of the files which they want to be hidden. Is that really the case or just a speculation?
              – Utku
              Oct 5 '15 at 14:17




              "More generally, ls and wildcards hide all files whose name begins with a .; this is a simple way to exclude . and .. and allow users to hide other files from listings." This sounds like the following: The concept of hiding files/directories that start with a dot has actually appeared to hide . ... But later, people realized that being able to hide some files/directories has a value in it and hence, they began to put a dot at the beginning of the files which they want to be hidden. Is that really the case or just a speculation?
              – Utku
              Oct 5 '15 at 14:17




              3




              3




              @Utku Actually, it was the other way round, as least at first: the original developer intended to hide only . and .. but made a mistake. It's however possible that he was dissuaded from fixing it because some users found it useful, and the reason why user configuration files start with . is definitely so that they don't clutter the output of ls in the home directory. I think we have a question about this here but I can't find it, it may have been mistagged.
              – Gilles
              Oct 5 '15 at 18:49




              @Utku Actually, it was the other way round, as least at first: the original developer intended to hide only . and .. but made a mistake. It's however possible that he was dissuaded from fixing it because some users found it useful, and the reason why user configuration files start with . is definitely so that they don't clutter the output of ls in the home directory. I think we have a question about this here but I can't find it, it may have been mistagged.
              – Gilles
              Oct 5 '15 at 18:49













              15














              Directorys starting with a dot . are considered to be hidden. That means:




              • ~/somedirectory and ~/.somedirectory are different directories. That is if ~/somedirectory existed and you did mkdir ~/.somedirectory, you won't fail with a File Exists message.


              • The ls command will not show those directories starting with the .


              • The ls -a will show both directories







              share|improve this answer



















              • 5




                ls -A displays files and directories that start with . but doesn't include the . and .. entries.
                – Julian
                Sep 30 '11 at 15:47
















              15














              Directorys starting with a dot . are considered to be hidden. That means:




              • ~/somedirectory and ~/.somedirectory are different directories. That is if ~/somedirectory existed and you did mkdir ~/.somedirectory, you won't fail with a File Exists message.


              • The ls command will not show those directories starting with the .


              • The ls -a will show both directories







              share|improve this answer



















              • 5




                ls -A displays files and directories that start with . but doesn't include the . and .. entries.
                – Julian
                Sep 30 '11 at 15:47














              15












              15








              15






              Directorys starting with a dot . are considered to be hidden. That means:




              • ~/somedirectory and ~/.somedirectory are different directories. That is if ~/somedirectory existed and you did mkdir ~/.somedirectory, you won't fail with a File Exists message.


              • The ls command will not show those directories starting with the .


              • The ls -a will show both directories







              share|improve this answer














              Directorys starting with a dot . are considered to be hidden. That means:




              • ~/somedirectory and ~/.somedirectory are different directories. That is if ~/somedirectory existed and you did mkdir ~/.somedirectory, you won't fail with a File Exists message.


              • The ls command will not show those directories starting with the .


              • The ls -a will show both directories








              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited 2 hours ago









              Minix

              2,19651940




              2,19651940










              answered Sep 30 '11 at 15:06









              TomTom

              25113




              25113








              • 5




                ls -A displays files and directories that start with . but doesn't include the . and .. entries.
                – Julian
                Sep 30 '11 at 15:47














              • 5




                ls -A displays files and directories that start with . but doesn't include the . and .. entries.
                – Julian
                Sep 30 '11 at 15:47








              5




              5




              ls -A displays files and directories that start with . but doesn't include the . and .. entries.
              – Julian
              Sep 30 '11 at 15:47




              ls -A displays files and directories that start with . but doesn't include the . and .. entries.
              – Julian
              Sep 30 '11 at 15:47











              7














              For details on the Unix file system check the standard. Specifically, dot files are used for configuration files in a users directory, and if a program has more than one, it should put them into a dot directory.



              This hides the files from the user, unless they want to find them. That way they don't get in the way, and tools don't go messing with them accidentally.






              share|improve this answer


























                7














                For details on the Unix file system check the standard. Specifically, dot files are used for configuration files in a users directory, and if a program has more than one, it should put them into a dot directory.



                This hides the files from the user, unless they want to find them. That way they don't get in the way, and tools don't go messing with them accidentally.






                share|improve this answer
























                  7












                  7








                  7






                  For details on the Unix file system check the standard. Specifically, dot files are used for configuration files in a users directory, and if a program has more than one, it should put them into a dot directory.



                  This hides the files from the user, unless they want to find them. That way they don't get in the way, and tools don't go messing with them accidentally.






                  share|improve this answer












                  For details on the Unix file system check the standard. Specifically, dot files are used for configuration files in a users directory, and if a program has more than one, it should put them into a dot directory.



                  This hides the files from the user, unless they want to find them. That way they don't get in the way, and tools don't go messing with them accidentally.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Sep 30 '11 at 15:11









                  Spencer RathbunSpencer Rathbun

                  20616




                  20616























                      4














                      The leading "." in a directory or file name causes that directory or file to be hidden when doing a ls command.






                      share|improve this answer

















                      • 1




                        You can view all files starting with "." with ls -a.
                        – Sardathrion
                        Sep 30 '11 at 15:06
















                      4














                      The leading "." in a directory or file name causes that directory or file to be hidden when doing a ls command.






                      share|improve this answer

















                      • 1




                        You can view all files starting with "." with ls -a.
                        – Sardathrion
                        Sep 30 '11 at 15:06














                      4












                      4








                      4






                      The leading "." in a directory or file name causes that directory or file to be hidden when doing a ls command.






                      share|improve this answer












                      The leading "." in a directory or file name causes that directory or file to be hidden when doing a ls command.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Sep 30 '11 at 14:59







                      DaveNay















                      • 1




                        You can view all files starting with "." with ls -a.
                        – Sardathrion
                        Sep 30 '11 at 15:06














                      • 1




                        You can view all files starting with "." with ls -a.
                        – Sardathrion
                        Sep 30 '11 at 15:06








                      1




                      1




                      You can view all files starting with "." with ls -a.
                      – Sardathrion
                      Sep 30 '11 at 15:06




                      You can view all files starting with "." with ls -a.
                      – Sardathrion
                      Sep 30 '11 at 15:06











                      1














                      Like @DaveNay already said, that period will cause the file or directory to be hidden.



                      For your second implicit question, this is how you search for that in google:



                      Just type in the search box: linux period before name






                      share|improve this answer


























                        1














                        Like @DaveNay already said, that period will cause the file or directory to be hidden.



                        For your second implicit question, this is how you search for that in google:



                        Just type in the search box: linux period before name






                        share|improve this answer
























                          1












                          1








                          1






                          Like @DaveNay already said, that period will cause the file or directory to be hidden.



                          For your second implicit question, this is how you search for that in google:



                          Just type in the search box: linux period before name






                          share|improve this answer












                          Like @DaveNay already said, that period will cause the file or directory to be hidden.



                          For your second implicit question, this is how you search for that in google:



                          Just type in the search box: linux period before name







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Sep 30 '11 at 15:07







                          AJC





































                              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.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • 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%2f21778%2fwhats-so-special-about-directories-whose-names-begin-with-a-dot%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

                              サソリ

                              広島県道265号伴広島線

                              Accessing regular linux commands in Huawei's Dopra Linux