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.
shell directory
add a comment |
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.
shell directory
add a comment |
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.
shell directory
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
shell directory
edited Nov 26 at 14:04
Kusalananda
118k16223364
118k16223364
asked Nov 26 at 13:29
soti84
32
32
add a comment |
add a comment |
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 /
.
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
thenls -l
andls ./-l
will give different results).
– glenn jackman
Nov 26 at 16:07
add a comment |
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 /
.
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
thenls -l
andls ./-l
will give different results).
– glenn jackman
Nov 26 at 16:07
add a comment |
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 /
.
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
thenls -l
andls ./-l
will give different results).
– glenn jackman
Nov 26 at 16:07
add a comment |
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 /
.
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 /
.
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
thenls -l
andls ./-l
will give different results).
– glenn jackman
Nov 26 at 16:07
add a comment |
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
thenls -l
andls ./-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
add a comment |
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.
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
Required, but never shown
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
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
Required, but never shown
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
Required, but never shown
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
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