Copying [use of cp] issue
I have a couple of sub-folders mounted on /mnt. One is /mnt/data, and the other is /mnt/1804iso. The /data includes data folders and files mounted from another disk, and /1804iso includes a mounted ISO file whose contents I wanted to copy to folder /media/benny/0EB4-95E2/ which is a mounted flash-drive.
So I opened bash and typed sudo cp -Rn /mnt/1804iso/.* /media/benny/0EB4-95E2/
. I would normally have omitted the period before wildcard asterisk /*/, but if I do that then a hidden file within the ISO does not copy over. So with this command one strange thing occurred. After copying over the ISO files correctly, then it started to copy over the /mnt/data folders and files as well. I cannot see why that can happen as there is no reference to that folder, unless my understanding of the command part /mnt/1804iso/.*
is totally flawed.
Could someone kindly explain why my /mnt/data
folder was included for copying?
bash cp gnome-shell
New contributor
add a comment |
I have a couple of sub-folders mounted on /mnt. One is /mnt/data, and the other is /mnt/1804iso. The /data includes data folders and files mounted from another disk, and /1804iso includes a mounted ISO file whose contents I wanted to copy to folder /media/benny/0EB4-95E2/ which is a mounted flash-drive.
So I opened bash and typed sudo cp -Rn /mnt/1804iso/.* /media/benny/0EB4-95E2/
. I would normally have omitted the period before wildcard asterisk /*/, but if I do that then a hidden file within the ISO does not copy over. So with this command one strange thing occurred. After copying over the ISO files correctly, then it started to copy over the /mnt/data folders and files as well. I cannot see why that can happen as there is no reference to that folder, unless my understanding of the command part /mnt/1804iso/.*
is totally flawed.
Could someone kindly explain why my /mnt/data
folder was included for copying?
bash cp gnome-shell
New contributor
1
Possibly related:command .*
acts on the parent directory
– steeldriver
4 hours ago
1
Yes there is a reference: every directory contains..
a reference to its parent directory.
– ctrl-alt-delor
4 hours ago
See also the nice discussion at Linux command line: glob confusion
– steeldriver
4 hours ago
shopt -s dotglob
, will make*
also match most files starting with a.
, but not.
and..
.
– ctrl-alt-delor
4 hours ago
add a comment |
I have a couple of sub-folders mounted on /mnt. One is /mnt/data, and the other is /mnt/1804iso. The /data includes data folders and files mounted from another disk, and /1804iso includes a mounted ISO file whose contents I wanted to copy to folder /media/benny/0EB4-95E2/ which is a mounted flash-drive.
So I opened bash and typed sudo cp -Rn /mnt/1804iso/.* /media/benny/0EB4-95E2/
. I would normally have omitted the period before wildcard asterisk /*/, but if I do that then a hidden file within the ISO does not copy over. So with this command one strange thing occurred. After copying over the ISO files correctly, then it started to copy over the /mnt/data folders and files as well. I cannot see why that can happen as there is no reference to that folder, unless my understanding of the command part /mnt/1804iso/.*
is totally flawed.
Could someone kindly explain why my /mnt/data
folder was included for copying?
bash cp gnome-shell
New contributor
I have a couple of sub-folders mounted on /mnt. One is /mnt/data, and the other is /mnt/1804iso. The /data includes data folders and files mounted from another disk, and /1804iso includes a mounted ISO file whose contents I wanted to copy to folder /media/benny/0EB4-95E2/ which is a mounted flash-drive.
So I opened bash and typed sudo cp -Rn /mnt/1804iso/.* /media/benny/0EB4-95E2/
. I would normally have omitted the period before wildcard asterisk /*/, but if I do that then a hidden file within the ISO does not copy over. So with this command one strange thing occurred. After copying over the ISO files correctly, then it started to copy over the /mnt/data folders and files as well. I cannot see why that can happen as there is no reference to that folder, unless my understanding of the command part /mnt/1804iso/.*
is totally flawed.
Could someone kindly explain why my /mnt/data
folder was included for copying?
bash cp gnome-shell
bash cp gnome-shell
New contributor
New contributor
edited 5 hours ago
Michael Homer
48.2k8127167
48.2k8127167
New contributor
asked 5 hours ago
Paul BensonPaul Benson
1112
1112
New contributor
New contributor
1
Possibly related:command .*
acts on the parent directory
– steeldriver
4 hours ago
1
Yes there is a reference: every directory contains..
a reference to its parent directory.
– ctrl-alt-delor
4 hours ago
See also the nice discussion at Linux command line: glob confusion
– steeldriver
4 hours ago
shopt -s dotglob
, will make*
also match most files starting with a.
, but not.
and..
.
– ctrl-alt-delor
4 hours ago
add a comment |
1
Possibly related:command .*
acts on the parent directory
– steeldriver
4 hours ago
1
Yes there is a reference: every directory contains..
a reference to its parent directory.
– ctrl-alt-delor
4 hours ago
See also the nice discussion at Linux command line: glob confusion
– steeldriver
4 hours ago
shopt -s dotglob
, will make*
also match most files starting with a.
, but not.
and..
.
– ctrl-alt-delor
4 hours ago
1
1
Possibly related:
command .*
acts on the parent directory– steeldriver
4 hours ago
Possibly related:
command .*
acts on the parent directory– steeldriver
4 hours ago
1
1
Yes there is a reference: every directory contains
..
a reference to its parent directory.– ctrl-alt-delor
4 hours ago
Yes there is a reference: every directory contains
..
a reference to its parent directory.– ctrl-alt-delor
4 hours ago
See also the nice discussion at Linux command line: glob confusion
– steeldriver
4 hours ago
See also the nice discussion at Linux command line: glob confusion
– steeldriver
4 hours ago
shopt -s dotglob
, will make *
also match most files starting with a .
, but not .
and ..
.– ctrl-alt-delor
4 hours ago
shopt -s dotglob
, will make *
also match most files starting with a .
, but not .
and ..
.– ctrl-alt-delor
4 hours ago
add a comment |
2 Answers
2
active
oldest
votes
.*
will expand to your hidden file, .
, and ..
. This is an unfortunate part of how Bash filename expansion works: there is a directory entry called ..
, which consists of an initial .
and then any number of characters after it, so it's matched by .*
and included.
You can see this happen by running e.g.:
echo /mnt/1804iso/.*
which will list out /mnt/1804iso/.
and /mnt/1804iso/..
along with the rest.
../data
is your data
directory. You will end up with a directory structure in the destination like this:
.hidden
xyz
data/
data/...
1804iso/.hidden
1804iso/xyz
...
That is, you'll actually end up with two copies of everything you wanted to copy, plus all that stuff you didn't. If you use cp -Rnv
you'll see what it's copying and where to as it goes.
Some other shells will be nicer about this. In zsh, it would have done closer to what you want: only the hidden file would have been copied. In Bash, you could use cp src/.[^.]* dest
to match the zsh behaviour, and list two source locations. Alternatively, you can run shopt -s dotglob
beforehand, and then src/*
will expand to include the dotfiles, but exclude the .
and ..
entries (but this may lead to doing things you didn't mean to later on, so be careful).
For what you actually wanted to do, I suggest using rsync instead:
rsync -avx /mnt/1804iso/ /media/benny/0EB4-95E2/
This will copy the contents of the 1804iso
directory to the destination (note final slash!), including any hidden files.
I think I follow you. Because of my use of .*, I end up with an option of /mnt/1804iso/.. which is the equivalent of my parent folder/mnt
in this case. So, not only does /mnt/1804iso/ get copied but everything else within/mnt
Is that right? I thinkrsync
is safer, but I tend to use that for back-ups ratrher than simple file/folder copying.
– Paul Benson
4 hours ago
Probably. It may depend a little on exactly how yourcp
implementation works (some will fail early and stop trying), but you've definitely asked it to copy1804iso
's parent directory recursively.
– Michael Homer
4 hours ago
Your bash example is not quite equivalent, since it would miss a file named..foo
– Nate Eldredge
1 min ago
add a comment |
The pattern /mnt/1804iso/.*
expands to, amongst possibly other things, the directory entry /mnt/1804iso/..
, which is the same as /mnt
. I'm geussing that's why it started copying /mnt/data
.
In this case, I would just use rsync
:
rsync -ai /mnt/1804iso/ /media/benny/0EB4-95E2
This would copy all of /mnt/1804iso
, including hidden files, into /media/benny/0EB4-95E2
. Leaving off the /
at the end of the source directory would create a 1804iso
directory below the target directory.
Alternatively, enable the dotglob
shell option in bash
with shopt -s dotglob
to make *
match hidden names as well as non-hidden names (but not .
or ..
). Then use
cp -Rn /mnt/1804iso/* /media/benny/0EB4-95E2/
add a comment |
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
});
}
});
Paul Benson is a new contributor. Be nice, and check out our Code of Conduct.
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%2f499811%2fcopying-use-of-cp-issue%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
.*
will expand to your hidden file, .
, and ..
. This is an unfortunate part of how Bash filename expansion works: there is a directory entry called ..
, which consists of an initial .
and then any number of characters after it, so it's matched by .*
and included.
You can see this happen by running e.g.:
echo /mnt/1804iso/.*
which will list out /mnt/1804iso/.
and /mnt/1804iso/..
along with the rest.
../data
is your data
directory. You will end up with a directory structure in the destination like this:
.hidden
xyz
data/
data/...
1804iso/.hidden
1804iso/xyz
...
That is, you'll actually end up with two copies of everything you wanted to copy, plus all that stuff you didn't. If you use cp -Rnv
you'll see what it's copying and where to as it goes.
Some other shells will be nicer about this. In zsh, it would have done closer to what you want: only the hidden file would have been copied. In Bash, you could use cp src/.[^.]* dest
to match the zsh behaviour, and list two source locations. Alternatively, you can run shopt -s dotglob
beforehand, and then src/*
will expand to include the dotfiles, but exclude the .
and ..
entries (but this may lead to doing things you didn't mean to later on, so be careful).
For what you actually wanted to do, I suggest using rsync instead:
rsync -avx /mnt/1804iso/ /media/benny/0EB4-95E2/
This will copy the contents of the 1804iso
directory to the destination (note final slash!), including any hidden files.
I think I follow you. Because of my use of .*, I end up with an option of /mnt/1804iso/.. which is the equivalent of my parent folder/mnt
in this case. So, not only does /mnt/1804iso/ get copied but everything else within/mnt
Is that right? I thinkrsync
is safer, but I tend to use that for back-ups ratrher than simple file/folder copying.
– Paul Benson
4 hours ago
Probably. It may depend a little on exactly how yourcp
implementation works (some will fail early and stop trying), but you've definitely asked it to copy1804iso
's parent directory recursively.
– Michael Homer
4 hours ago
Your bash example is not quite equivalent, since it would miss a file named..foo
– Nate Eldredge
1 min ago
add a comment |
.*
will expand to your hidden file, .
, and ..
. This is an unfortunate part of how Bash filename expansion works: there is a directory entry called ..
, which consists of an initial .
and then any number of characters after it, so it's matched by .*
and included.
You can see this happen by running e.g.:
echo /mnt/1804iso/.*
which will list out /mnt/1804iso/.
and /mnt/1804iso/..
along with the rest.
../data
is your data
directory. You will end up with a directory structure in the destination like this:
.hidden
xyz
data/
data/...
1804iso/.hidden
1804iso/xyz
...
That is, you'll actually end up with two copies of everything you wanted to copy, plus all that stuff you didn't. If you use cp -Rnv
you'll see what it's copying and where to as it goes.
Some other shells will be nicer about this. In zsh, it would have done closer to what you want: only the hidden file would have been copied. In Bash, you could use cp src/.[^.]* dest
to match the zsh behaviour, and list two source locations. Alternatively, you can run shopt -s dotglob
beforehand, and then src/*
will expand to include the dotfiles, but exclude the .
and ..
entries (but this may lead to doing things you didn't mean to later on, so be careful).
For what you actually wanted to do, I suggest using rsync instead:
rsync -avx /mnt/1804iso/ /media/benny/0EB4-95E2/
This will copy the contents of the 1804iso
directory to the destination (note final slash!), including any hidden files.
I think I follow you. Because of my use of .*, I end up with an option of /mnt/1804iso/.. which is the equivalent of my parent folder/mnt
in this case. So, not only does /mnt/1804iso/ get copied but everything else within/mnt
Is that right? I thinkrsync
is safer, but I tend to use that for back-ups ratrher than simple file/folder copying.
– Paul Benson
4 hours ago
Probably. It may depend a little on exactly how yourcp
implementation works (some will fail early and stop trying), but you've definitely asked it to copy1804iso
's parent directory recursively.
– Michael Homer
4 hours ago
Your bash example is not quite equivalent, since it would miss a file named..foo
– Nate Eldredge
1 min ago
add a comment |
.*
will expand to your hidden file, .
, and ..
. This is an unfortunate part of how Bash filename expansion works: there is a directory entry called ..
, which consists of an initial .
and then any number of characters after it, so it's matched by .*
and included.
You can see this happen by running e.g.:
echo /mnt/1804iso/.*
which will list out /mnt/1804iso/.
and /mnt/1804iso/..
along with the rest.
../data
is your data
directory. You will end up with a directory structure in the destination like this:
.hidden
xyz
data/
data/...
1804iso/.hidden
1804iso/xyz
...
That is, you'll actually end up with two copies of everything you wanted to copy, plus all that stuff you didn't. If you use cp -Rnv
you'll see what it's copying and where to as it goes.
Some other shells will be nicer about this. In zsh, it would have done closer to what you want: only the hidden file would have been copied. In Bash, you could use cp src/.[^.]* dest
to match the zsh behaviour, and list two source locations. Alternatively, you can run shopt -s dotglob
beforehand, and then src/*
will expand to include the dotfiles, but exclude the .
and ..
entries (but this may lead to doing things you didn't mean to later on, so be careful).
For what you actually wanted to do, I suggest using rsync instead:
rsync -avx /mnt/1804iso/ /media/benny/0EB4-95E2/
This will copy the contents of the 1804iso
directory to the destination (note final slash!), including any hidden files.
.*
will expand to your hidden file, .
, and ..
. This is an unfortunate part of how Bash filename expansion works: there is a directory entry called ..
, which consists of an initial .
and then any number of characters after it, so it's matched by .*
and included.
You can see this happen by running e.g.:
echo /mnt/1804iso/.*
which will list out /mnt/1804iso/.
and /mnt/1804iso/..
along with the rest.
../data
is your data
directory. You will end up with a directory structure in the destination like this:
.hidden
xyz
data/
data/...
1804iso/.hidden
1804iso/xyz
...
That is, you'll actually end up with two copies of everything you wanted to copy, plus all that stuff you didn't. If you use cp -Rnv
you'll see what it's copying and where to as it goes.
Some other shells will be nicer about this. In zsh, it would have done closer to what you want: only the hidden file would have been copied. In Bash, you could use cp src/.[^.]* dest
to match the zsh behaviour, and list two source locations. Alternatively, you can run shopt -s dotglob
beforehand, and then src/*
will expand to include the dotfiles, but exclude the .
and ..
entries (but this may lead to doing things you didn't mean to later on, so be careful).
For what you actually wanted to do, I suggest using rsync instead:
rsync -avx /mnt/1804iso/ /media/benny/0EB4-95E2/
This will copy the contents of the 1804iso
directory to the destination (note final slash!), including any hidden files.
answered 4 hours ago
Michael HomerMichael Homer
48.2k8127167
48.2k8127167
I think I follow you. Because of my use of .*, I end up with an option of /mnt/1804iso/.. which is the equivalent of my parent folder/mnt
in this case. So, not only does /mnt/1804iso/ get copied but everything else within/mnt
Is that right? I thinkrsync
is safer, but I tend to use that for back-ups ratrher than simple file/folder copying.
– Paul Benson
4 hours ago
Probably. It may depend a little on exactly how yourcp
implementation works (some will fail early and stop trying), but you've definitely asked it to copy1804iso
's parent directory recursively.
– Michael Homer
4 hours ago
Your bash example is not quite equivalent, since it would miss a file named..foo
– Nate Eldredge
1 min ago
add a comment |
I think I follow you. Because of my use of .*, I end up with an option of /mnt/1804iso/.. which is the equivalent of my parent folder/mnt
in this case. So, not only does /mnt/1804iso/ get copied but everything else within/mnt
Is that right? I thinkrsync
is safer, but I tend to use that for back-ups ratrher than simple file/folder copying.
– Paul Benson
4 hours ago
Probably. It may depend a little on exactly how yourcp
implementation works (some will fail early and stop trying), but you've definitely asked it to copy1804iso
's parent directory recursively.
– Michael Homer
4 hours ago
Your bash example is not quite equivalent, since it would miss a file named..foo
– Nate Eldredge
1 min ago
I think I follow you. Because of my use of .*, I end up with an option of /mnt/1804iso/.. which is the equivalent of my parent folder
/mnt
in this case. So, not only does /mnt/1804iso/ get copied but everything else within /mnt
Is that right? I think rsync
is safer, but I tend to use that for back-ups ratrher than simple file/folder copying.– Paul Benson
4 hours ago
I think I follow you. Because of my use of .*, I end up with an option of /mnt/1804iso/.. which is the equivalent of my parent folder
/mnt
in this case. So, not only does /mnt/1804iso/ get copied but everything else within /mnt
Is that right? I think rsync
is safer, but I tend to use that for back-ups ratrher than simple file/folder copying.– Paul Benson
4 hours ago
Probably. It may depend a little on exactly how your
cp
implementation works (some will fail early and stop trying), but you've definitely asked it to copy 1804iso
's parent directory recursively.– Michael Homer
4 hours ago
Probably. It may depend a little on exactly how your
cp
implementation works (some will fail early and stop trying), but you've definitely asked it to copy 1804iso
's parent directory recursively.– Michael Homer
4 hours ago
Your bash example is not quite equivalent, since it would miss a file named
..foo
– Nate Eldredge
1 min ago
Your bash example is not quite equivalent, since it would miss a file named
..foo
– Nate Eldredge
1 min ago
add a comment |
The pattern /mnt/1804iso/.*
expands to, amongst possibly other things, the directory entry /mnt/1804iso/..
, which is the same as /mnt
. I'm geussing that's why it started copying /mnt/data
.
In this case, I would just use rsync
:
rsync -ai /mnt/1804iso/ /media/benny/0EB4-95E2
This would copy all of /mnt/1804iso
, including hidden files, into /media/benny/0EB4-95E2
. Leaving off the /
at the end of the source directory would create a 1804iso
directory below the target directory.
Alternatively, enable the dotglob
shell option in bash
with shopt -s dotglob
to make *
match hidden names as well as non-hidden names (but not .
or ..
). Then use
cp -Rn /mnt/1804iso/* /media/benny/0EB4-95E2/
add a comment |
The pattern /mnt/1804iso/.*
expands to, amongst possibly other things, the directory entry /mnt/1804iso/..
, which is the same as /mnt
. I'm geussing that's why it started copying /mnt/data
.
In this case, I would just use rsync
:
rsync -ai /mnt/1804iso/ /media/benny/0EB4-95E2
This would copy all of /mnt/1804iso
, including hidden files, into /media/benny/0EB4-95E2
. Leaving off the /
at the end of the source directory would create a 1804iso
directory below the target directory.
Alternatively, enable the dotglob
shell option in bash
with shopt -s dotglob
to make *
match hidden names as well as non-hidden names (but not .
or ..
). Then use
cp -Rn /mnt/1804iso/* /media/benny/0EB4-95E2/
add a comment |
The pattern /mnt/1804iso/.*
expands to, amongst possibly other things, the directory entry /mnt/1804iso/..
, which is the same as /mnt
. I'm geussing that's why it started copying /mnt/data
.
In this case, I would just use rsync
:
rsync -ai /mnt/1804iso/ /media/benny/0EB4-95E2
This would copy all of /mnt/1804iso
, including hidden files, into /media/benny/0EB4-95E2
. Leaving off the /
at the end of the source directory would create a 1804iso
directory below the target directory.
Alternatively, enable the dotglob
shell option in bash
with shopt -s dotglob
to make *
match hidden names as well as non-hidden names (but not .
or ..
). Then use
cp -Rn /mnt/1804iso/* /media/benny/0EB4-95E2/
The pattern /mnt/1804iso/.*
expands to, amongst possibly other things, the directory entry /mnt/1804iso/..
, which is the same as /mnt
. I'm geussing that's why it started copying /mnt/data
.
In this case, I would just use rsync
:
rsync -ai /mnt/1804iso/ /media/benny/0EB4-95E2
This would copy all of /mnt/1804iso
, including hidden files, into /media/benny/0EB4-95E2
. Leaving off the /
at the end of the source directory would create a 1804iso
directory below the target directory.
Alternatively, enable the dotglob
shell option in bash
with shopt -s dotglob
to make *
match hidden names as well as non-hidden names (but not .
or ..
). Then use
cp -Rn /mnt/1804iso/* /media/benny/0EB4-95E2/
edited 4 hours ago
answered 4 hours ago
KusalanandaKusalananda
129k16243400
129k16243400
add a comment |
add a comment |
Paul Benson is a new contributor. Be nice, and check out our Code of Conduct.
Paul Benson is a new contributor. Be nice, and check out our Code of Conduct.
Paul Benson is a new contributor. Be nice, and check out our Code of Conduct.
Paul Benson is a new contributor. Be nice, and check out our Code of Conduct.
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.
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%2f499811%2fcopying-use-of-cp-issue%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
1
Possibly related:
command .*
acts on the parent directory– steeldriver
4 hours ago
1
Yes there is a reference: every directory contains
..
a reference to its parent directory.– ctrl-alt-delor
4 hours ago
See also the nice discussion at Linux command line: glob confusion
– steeldriver
4 hours ago
shopt -s dotglob
, will make*
also match most files starting with a.
, but not.
and..
.– ctrl-alt-delor
4 hours ago