Meaning of dot (.) in The Following Examples











up vote
0
down vote

favorite












I would like to know the meaning of the dot (.) in the following examples:



dotslash at the front of the path:



cp -r ./dist/amd/ ../../aurelia-amd/animator-css


Is this equivalent to



cp -r dist/amd/ ../../aurelia-amd/animator-css


dot at the end of the destination path:



cp -r DEBIAN/amd64/* package/riaps-pycom-amd64/DEBIAN/.


Thanks.










share|improve this question




























    up vote
    0
    down vote

    favorite












    I would like to know the meaning of the dot (.) in the following examples:



    dotslash at the front of the path:



    cp -r ./dist/amd/ ../../aurelia-amd/animator-css


    Is this equivalent to



    cp -r dist/amd/ ../../aurelia-amd/animator-css


    dot at the end of the destination path:



    cp -r DEBIAN/amd64/* package/riaps-pycom-amd64/DEBIAN/.


    Thanks.










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I would like to know the meaning of the dot (.) in the following examples:



      dotslash at the front of the path:



      cp -r ./dist/amd/ ../../aurelia-amd/animator-css


      Is this equivalent to



      cp -r dist/amd/ ../../aurelia-amd/animator-css


      dot at the end of the destination path:



      cp -r DEBIAN/amd64/* package/riaps-pycom-amd64/DEBIAN/.


      Thanks.










      share|improve this question















      I would like to know the meaning of the dot (.) in the following examples:



      dotslash at the front of the path:



      cp -r ./dist/amd/ ../../aurelia-amd/animator-css


      Is this equivalent to



      cp -r dist/amd/ ../../aurelia-amd/animator-css


      dot at the end of the destination path:



      cp -r DEBIAN/amd64/* package/riaps-pycom-amd64/DEBIAN/.


      Thanks.







      shell directory






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 26 at 14:04









      Kusalananda

      118k16223364




      118k16223364










      asked Nov 26 at 13:29









      soti84

      32




      32






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          The single dots, in these examples, can be removed.



          dist and ./dist are the same things, as is package/riaps-pycom-amd64/DEBIAN/. and package/riaps-pycom-amd64/DEBIAN/.



          The dot, when used as part of a pathname, means "this directory". In DEBIAN/. it is like saying "in the DEBIAN directory, here".



          Technically, the dot is a hard link to (i.e. another name for) the same directory that it is located in, and is available in every single directory on a Unix system. Likewise, the double-dot is another name for the parent directory.





          Side note:



          DEBIAN/ and DEBIAN are only slightly different if DEBIAN is a symbolic link. If it is not a symbolic link, then they are the same, but if DEBIAN is a symbolic link, then DEBIAN would refer to the symbolic link itself (which the utility, cp in this case, would resolve to a directory), while DEBIAN/ would be resolved to a directory by the shell.



          The trailing / may also be interpreted by the utility in special ways under some circumstances. A typical example is the source location of rsync. With a trailing / on the source, rsync -r or rsync -a would copy the contents of the directory, but would create a subdirectory for the contents if the source was specified without a trailing /.






          share|improve this answer























          • Thank you, Kusalananda.
            – soti84
            Nov 26 at 13:54










          • Also, when in an interactive bash session, the ./ is useful to narrow tab-completion results to the current directory (for example, if $CDPATH is set, tab-completion may pick up subdirectories from $CDPATH directories), or for oddly named files (for example if a file is named -l then ls -l and ls ./-l will give different results).
            – glenn jackman
            Nov 26 at 16:07













          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: 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%2f484209%2fmeaning-of-dot-in-the-following-examples%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          The single dots, in these examples, can be removed.



          dist and ./dist are the same things, as is package/riaps-pycom-amd64/DEBIAN/. and package/riaps-pycom-amd64/DEBIAN/.



          The dot, when used as part of a pathname, means "this directory". In DEBIAN/. it is like saying "in the DEBIAN directory, here".



          Technically, the dot is a hard link to (i.e. another name for) the same directory that it is located in, and is available in every single directory on a Unix system. Likewise, the double-dot is another name for the parent directory.





          Side note:



          DEBIAN/ and DEBIAN are only slightly different if DEBIAN is a symbolic link. If it is not a symbolic link, then they are the same, but if DEBIAN is a symbolic link, then DEBIAN would refer to the symbolic link itself (which the utility, cp in this case, would resolve to a directory), while DEBIAN/ would be resolved to a directory by the shell.



          The trailing / may also be interpreted by the utility in special ways under some circumstances. A typical example is the source location of rsync. With a trailing / on the source, rsync -r or rsync -a would copy the contents of the directory, but would create a subdirectory for the contents if the source was specified without a trailing /.






          share|improve this answer























          • Thank you, Kusalananda.
            – soti84
            Nov 26 at 13:54










          • Also, when in an interactive bash session, the ./ is useful to narrow tab-completion results to the current directory (for example, if $CDPATH is set, tab-completion may pick up subdirectories from $CDPATH directories), or for oddly named files (for example if a file is named -l then ls -l and ls ./-l will give different results).
            – glenn jackman
            Nov 26 at 16:07

















          up vote
          1
          down vote



          accepted










          The single dots, in these examples, can be removed.



          dist and ./dist are the same things, as is package/riaps-pycom-amd64/DEBIAN/. and package/riaps-pycom-amd64/DEBIAN/.



          The dot, when used as part of a pathname, means "this directory". In DEBIAN/. it is like saying "in the DEBIAN directory, here".



          Technically, the dot is a hard link to (i.e. another name for) the same directory that it is located in, and is available in every single directory on a Unix system. Likewise, the double-dot is another name for the parent directory.





          Side note:



          DEBIAN/ and DEBIAN are only slightly different if DEBIAN is a symbolic link. If it is not a symbolic link, then they are the same, but if DEBIAN is a symbolic link, then DEBIAN would refer to the symbolic link itself (which the utility, cp in this case, would resolve to a directory), while DEBIAN/ would be resolved to a directory by the shell.



          The trailing / may also be interpreted by the utility in special ways under some circumstances. A typical example is the source location of rsync. With a trailing / on the source, rsync -r or rsync -a would copy the contents of the directory, but would create a subdirectory for the contents if the source was specified without a trailing /.






          share|improve this answer























          • Thank you, Kusalananda.
            – soti84
            Nov 26 at 13:54










          • Also, when in an interactive bash session, the ./ is useful to narrow tab-completion results to the current directory (for example, if $CDPATH is set, tab-completion may pick up subdirectories from $CDPATH directories), or for oddly named files (for example if a file is named -l then ls -l and ls ./-l will give different results).
            – glenn jackman
            Nov 26 at 16:07















          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          The single dots, in these examples, can be removed.



          dist and ./dist are the same things, as is package/riaps-pycom-amd64/DEBIAN/. and package/riaps-pycom-amd64/DEBIAN/.



          The dot, when used as part of a pathname, means "this directory". In DEBIAN/. it is like saying "in the DEBIAN directory, here".



          Technically, the dot is a hard link to (i.e. another name for) the same directory that it is located in, and is available in every single directory on a Unix system. Likewise, the double-dot is another name for the parent directory.





          Side note:



          DEBIAN/ and DEBIAN are only slightly different if DEBIAN is a symbolic link. If it is not a symbolic link, then they are the same, but if DEBIAN is a symbolic link, then DEBIAN would refer to the symbolic link itself (which the utility, cp in this case, would resolve to a directory), while DEBIAN/ would be resolved to a directory by the shell.



          The trailing / may also be interpreted by the utility in special ways under some circumstances. A typical example is the source location of rsync. With a trailing / on the source, rsync -r or rsync -a would copy the contents of the directory, but would create a subdirectory for the contents if the source was specified without a trailing /.






          share|improve this answer














          The single dots, in these examples, can be removed.



          dist and ./dist are the same things, as is package/riaps-pycom-amd64/DEBIAN/. and package/riaps-pycom-amd64/DEBIAN/.



          The dot, when used as part of a pathname, means "this directory". In DEBIAN/. it is like saying "in the DEBIAN directory, here".



          Technically, the dot is a hard link to (i.e. another name for) the same directory that it is located in, and is available in every single directory on a Unix system. Likewise, the double-dot is another name for the parent directory.





          Side note:



          DEBIAN/ and DEBIAN are only slightly different if DEBIAN is a symbolic link. If it is not a symbolic link, then they are the same, but if DEBIAN is a symbolic link, then DEBIAN would refer to the symbolic link itself (which the utility, cp in this case, would resolve to a directory), while DEBIAN/ would be resolved to a directory by the shell.



          The trailing / may also be interpreted by the utility in special ways under some circumstances. A typical example is the source location of rsync. With a trailing / on the source, rsync -r or rsync -a would copy the contents of the directory, but would create a subdirectory for the contents if the source was specified without a trailing /.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 26 at 13:43

























          answered Nov 26 at 13:36









          Kusalananda

          118k16223364




          118k16223364












          • Thank you, Kusalananda.
            – soti84
            Nov 26 at 13:54










          • Also, when in an interactive bash session, the ./ is useful to narrow tab-completion results to the current directory (for example, if $CDPATH is set, tab-completion may pick up subdirectories from $CDPATH directories), or for oddly named files (for example if a file is named -l then ls -l and ls ./-l will give different results).
            – glenn jackman
            Nov 26 at 16:07




















          • Thank you, Kusalananda.
            – soti84
            Nov 26 at 13:54










          • Also, when in an interactive bash session, the ./ is useful to narrow tab-completion results to the current directory (for example, if $CDPATH is set, tab-completion may pick up subdirectories from $CDPATH directories), or for oddly named files (for example if a file is named -l then ls -l and ls ./-l will give different results).
            – glenn jackman
            Nov 26 at 16:07


















          Thank you, Kusalananda.
          – soti84
          Nov 26 at 13:54




          Thank you, Kusalananda.
          – soti84
          Nov 26 at 13:54












          Also, when in an interactive bash session, the ./ is useful to narrow tab-completion results to the current directory (for example, if $CDPATH is set, tab-completion may pick up subdirectories from $CDPATH directories), or for oddly named files (for example if a file is named -l then ls -l and ls ./-l will give different results).
          – glenn jackman
          Nov 26 at 16:07






          Also, when in an interactive bash session, the ./ is useful to narrow tab-completion results to the current directory (for example, if $CDPATH is set, tab-completion may pick up subdirectories from $CDPATH directories), or for oddly named files (for example if a file is named -l then ls -l and ls ./-l will give different results).
          – glenn jackman
          Nov 26 at 16:07




















          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%2f484209%2fmeaning-of-dot-in-the-following-examples%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

          Morgemoulin

          Scott Moir

          Souastre