What does it mean this command cp /etc/. /tmp ?
What does it mean this command cp /etc/. /tmp ?
I don't understand about symbol "." after /etc/. Please, help to clarify. Thanks |
What is the context of this? (or--what are you trying to do?) On the surface of it, it does not make much sense.
Possible (special) meanings of "." in Bash: current directory prefix for a hidden file any character (in a regular expression) |
[ edit: Never mind - misread, but I'll leave my original interpretation anyway ]
It means somebody concatenated two path components together, but didn't bother with path canonicalization. The internal /./ is superfluous and can be removed. Eg: non-canonical path: /etc/. /tmp canonical path: /etc/tmp This routinely occurs when you have two vars combined into a path: Code:
$ base="/etc" |
Quote:
But, so far as I understand, the command in that post does nothing, because it interprets /etc/. as /etc and cp skips directories. |
Yes, I failed. It appeared as a single path to me. This is where a fixed-width font is useful (eg. place such text within [ code ] [ / code ] tags. Since font size/family is a browser's/user's choice, on my system the space is very hard to distinguish at 1600x1200 sitting 3 feet away from the monitor.
I knew the command would fail: Code:
$ cp empty/. ./newdir Thanks for the clarification. |
I can't see the blank either. I wondered whether one was there and tried selecting it with the cursor tool. Since I could select it, I knew it was there. Of course I agree such things should use code tags so we can see them.
But I still have no good guess what mistake by the OP or by whatever source he copied from is responsible for the useless command. |
All times are GMT -5. The time now is 11:42 AM. |