cp works differently on a Mac












6















I have the following code to copy an entire folder:



#!/bin/bash

B="H:pdf2txt"

DST_DIR="H:Test_Folder"

cp -r "$B" "$DST_DIR"


This works as expected on a windows machine but when I change it to this for my Mac:



#!/bin/bash

B="/Volumes/Mac_Storage/pdf2txt"

DST_DIR="/Volumes/Mac_Storage/Test_folder"

cp -r "$B" "$DST_DIR"


it copies the folder but then adds another copy within that one with the same content and then same again till the file path is too long for the mac to handle. folder structure like this:



Test_Folder
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt


etc etc..



Any idea why it works different from windows to Mac ?










share|improve this question

























  • Is this the entirety of the code? I can see some unused variables. I wonder if there is some kind of recursion? You can also debug with echo, e.g. repeat the cp… line with echo cp… above it, then see if the variables are as expected, and if it repeats unexpectedly.

    – Sparhawk
    14 hours ago













  • @Sparhawk Sorry I was only using that one variable to test it, have edited post. It was part of a larger code but have deleted everything to eleminate problems but even with just the code you see above I am having the same re-occuring copy problem.

    – madmiddle
    14 hours ago













  • Is there a symlinks?

    – Giacomo Catenazzi
    13 hours ago











  • @roaima apologies typo, now corrected

    – madmiddle
    13 hours ago
















6















I have the following code to copy an entire folder:



#!/bin/bash

B="H:pdf2txt"

DST_DIR="H:Test_Folder"

cp -r "$B" "$DST_DIR"


This works as expected on a windows machine but when I change it to this for my Mac:



#!/bin/bash

B="/Volumes/Mac_Storage/pdf2txt"

DST_DIR="/Volumes/Mac_Storage/Test_folder"

cp -r "$B" "$DST_DIR"


it copies the folder but then adds another copy within that one with the same content and then same again till the file path is too long for the mac to handle. folder structure like this:



Test_Folder
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt


etc etc..



Any idea why it works different from windows to Mac ?










share|improve this question

























  • Is this the entirety of the code? I can see some unused variables. I wonder if there is some kind of recursion? You can also debug with echo, e.g. repeat the cp… line with echo cp… above it, then see if the variables are as expected, and if it repeats unexpectedly.

    – Sparhawk
    14 hours ago













  • @Sparhawk Sorry I was only using that one variable to test it, have edited post. It was part of a larger code but have deleted everything to eleminate problems but even with just the code you see above I am having the same re-occuring copy problem.

    – madmiddle
    14 hours ago













  • Is there a symlinks?

    – Giacomo Catenazzi
    13 hours ago











  • @roaima apologies typo, now corrected

    – madmiddle
    13 hours ago














6












6








6


1






I have the following code to copy an entire folder:



#!/bin/bash

B="H:pdf2txt"

DST_DIR="H:Test_Folder"

cp -r "$B" "$DST_DIR"


This works as expected on a windows machine but when I change it to this for my Mac:



#!/bin/bash

B="/Volumes/Mac_Storage/pdf2txt"

DST_DIR="/Volumes/Mac_Storage/Test_folder"

cp -r "$B" "$DST_DIR"


it copies the folder but then adds another copy within that one with the same content and then same again till the file path is too long for the mac to handle. folder structure like this:



Test_Folder
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt


etc etc..



Any idea why it works different from windows to Mac ?










share|improve this question
















I have the following code to copy an entire folder:



#!/bin/bash

B="H:pdf2txt"

DST_DIR="H:Test_Folder"

cp -r "$B" "$DST_DIR"


This works as expected on a windows machine but when I change it to this for my Mac:



#!/bin/bash

B="/Volumes/Mac_Storage/pdf2txt"

DST_DIR="/Volumes/Mac_Storage/Test_folder"

cp -r "$B" "$DST_DIR"


it copies the folder but then adds another copy within that one with the same content and then same again till the file path is too long for the mac to handle. folder structure like this:



Test_Folder
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt
| ├── test1.txt
| ├── test2.txt
| └── pdf2txt


etc etc..



Any idea why it works different from windows to Mac ?







osx windows cp






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 13 hours ago







madmiddle

















asked 14 hours ago









madmiddlemadmiddle

625




625













  • Is this the entirety of the code? I can see some unused variables. I wonder if there is some kind of recursion? You can also debug with echo, e.g. repeat the cp… line with echo cp… above it, then see if the variables are as expected, and if it repeats unexpectedly.

    – Sparhawk
    14 hours ago













  • @Sparhawk Sorry I was only using that one variable to test it, have edited post. It was part of a larger code but have deleted everything to eleminate problems but even with just the code you see above I am having the same re-occuring copy problem.

    – madmiddle
    14 hours ago













  • Is there a symlinks?

    – Giacomo Catenazzi
    13 hours ago











  • @roaima apologies typo, now corrected

    – madmiddle
    13 hours ago



















  • Is this the entirety of the code? I can see some unused variables. I wonder if there is some kind of recursion? You can also debug with echo, e.g. repeat the cp… line with echo cp… above it, then see if the variables are as expected, and if it repeats unexpectedly.

    – Sparhawk
    14 hours ago













  • @Sparhawk Sorry I was only using that one variable to test it, have edited post. It was part of a larger code but have deleted everything to eleminate problems but even with just the code you see above I am having the same re-occuring copy problem.

    – madmiddle
    14 hours ago













  • Is there a symlinks?

    – Giacomo Catenazzi
    13 hours ago











  • @roaima apologies typo, now corrected

    – madmiddle
    13 hours ago

















Is this the entirety of the code? I can see some unused variables. I wonder if there is some kind of recursion? You can also debug with echo, e.g. repeat the cp… line with echo cp… above it, then see if the variables are as expected, and if it repeats unexpectedly.

– Sparhawk
14 hours ago







Is this the entirety of the code? I can see some unused variables. I wonder if there is some kind of recursion? You can also debug with echo, e.g. repeat the cp… line with echo cp… above it, then see if the variables are as expected, and if it repeats unexpectedly.

– Sparhawk
14 hours ago















@Sparhawk Sorry I was only using that one variable to test it, have edited post. It was part of a larger code but have deleted everything to eleminate problems but even with just the code you see above I am having the same re-occuring copy problem.

– madmiddle
14 hours ago







@Sparhawk Sorry I was only using that one variable to test it, have edited post. It was part of a larger code but have deleted everything to eleminate problems but even with just the code you see above I am having the same re-occuring copy problem.

– madmiddle
14 hours ago















Is there a symlinks?

– Giacomo Catenazzi
13 hours ago





Is there a symlinks?

– Giacomo Catenazzi
13 hours ago













@roaima apologies typo, now corrected

– madmiddle
13 hours ago





@roaima apologies typo, now corrected

– madmiddle
13 hours ago










2 Answers
2






active

oldest

votes


















8














I think telcoM's answer sniffs around the primary cause: It's likely to involve a symlink, just a different one.



Based on my experimentation, there's one set of circumstances that fits the bill:





  • Test_folder is a symlink to pdf2txt, and

  • the OP is using stock macOS cp, which has a BSD heritage


This sort of symlink defeats macOS cp's cycle detection. (GNU cp, as would've been installed by Homebrew or some other package manager, doesn't follow symlinks by default, even when copying recursively.)



Here's a demo, tested on macOS High Sierra:



$ ln -s pdf2txt Test_folder

$ ls -lAF Test_folder
lrwxr-xr-x 1 aho staff 7 Feb 13 20:13 Test_folder -> pdf2txt/

$ /bin/cp -r pdf2txt Test_folder
cp: Test_folder/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt: name too long (not copied)
cp: Test_folder/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt: name too long (not copied)

# Let's just look at the first 30 lines of a recursive ls
# (And yes, we're looking at pdf2txt)
$ ls -lRAF pdf2txt | head -n 30
pdf2txt:
total 0
drwxr-xr-x+ 5 aho staff 170 Feb 13 20:13 pdf2txt/
-rw-r--r--+ 1 aho staff 0 Feb 13 19:43 test1.txt
-rw-r--r--+ 1 aho staff 0 Feb 13 19:43 test2.txt

pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/
-rw-r--r--+ 1 aho staff 0 Feb 13 20:13 test1.txt
-rw-r--r--+ 1 aho staff 0 Feb 13 20:13 test2.txt

pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0





share|improve this answer
























  • Thats basically what I am getting, it just keeps going and going and going till that 'name too long' error. I shall try the command and update the post tonight

    – madmiddle
    12 hours ago



















5














Is there a symbolic link /Volumes/Mac_Storage/pdf2txt/pdf2txt pointing to .?



Run ls -l /Volumes/Mac_Storage/pdf2txt to check.



If you see a line like this:



lrwxrwxrwx 1 madmiddle madmiddle 1 Feb 12 12:34 pdf2txt -> .


... then that is the cause.



The command to create such a link would be ln -s . pdf2txt, which might be fairly easy to happen accidentally as a result of a typo.






share|improve this answer
























  • I'll have to read up on symbolic link is as I have no idea what that means. I shall run it tonight and get back to you.

    – madmiddle
    13 hours ago











  • Highly unlikely to be the case. macOS stock (BSD) cp stops the copy dead with the error cp: pdf2txt/pdf2txt: directory causes a cycle, which a Homebrew-installed (GNU) cp copies the directory correctly because it doesn't follow symlinks by default.

    – Adrian
    13 hours ago











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%2f500379%2fcp-works-differently-on-a-mac%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









8














I think telcoM's answer sniffs around the primary cause: It's likely to involve a symlink, just a different one.



Based on my experimentation, there's one set of circumstances that fits the bill:





  • Test_folder is a symlink to pdf2txt, and

  • the OP is using stock macOS cp, which has a BSD heritage


This sort of symlink defeats macOS cp's cycle detection. (GNU cp, as would've been installed by Homebrew or some other package manager, doesn't follow symlinks by default, even when copying recursively.)



Here's a demo, tested on macOS High Sierra:



$ ln -s pdf2txt Test_folder

$ ls -lAF Test_folder
lrwxr-xr-x 1 aho staff 7 Feb 13 20:13 Test_folder -> pdf2txt/

$ /bin/cp -r pdf2txt Test_folder
cp: Test_folder/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt: name too long (not copied)
cp: Test_folder/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt: name too long (not copied)

# Let's just look at the first 30 lines of a recursive ls
# (And yes, we're looking at pdf2txt)
$ ls -lRAF pdf2txt | head -n 30
pdf2txt:
total 0
drwxr-xr-x+ 5 aho staff 170 Feb 13 20:13 pdf2txt/
-rw-r--r--+ 1 aho staff 0 Feb 13 19:43 test1.txt
-rw-r--r--+ 1 aho staff 0 Feb 13 19:43 test2.txt

pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/
-rw-r--r--+ 1 aho staff 0 Feb 13 20:13 test1.txt
-rw-r--r--+ 1 aho staff 0 Feb 13 20:13 test2.txt

pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0





share|improve this answer
























  • Thats basically what I am getting, it just keeps going and going and going till that 'name too long' error. I shall try the command and update the post tonight

    – madmiddle
    12 hours ago
















8














I think telcoM's answer sniffs around the primary cause: It's likely to involve a symlink, just a different one.



Based on my experimentation, there's one set of circumstances that fits the bill:





  • Test_folder is a symlink to pdf2txt, and

  • the OP is using stock macOS cp, which has a BSD heritage


This sort of symlink defeats macOS cp's cycle detection. (GNU cp, as would've been installed by Homebrew or some other package manager, doesn't follow symlinks by default, even when copying recursively.)



Here's a demo, tested on macOS High Sierra:



$ ln -s pdf2txt Test_folder

$ ls -lAF Test_folder
lrwxr-xr-x 1 aho staff 7 Feb 13 20:13 Test_folder -> pdf2txt/

$ /bin/cp -r pdf2txt Test_folder
cp: Test_folder/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt: name too long (not copied)
cp: Test_folder/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt: name too long (not copied)

# Let's just look at the first 30 lines of a recursive ls
# (And yes, we're looking at pdf2txt)
$ ls -lRAF pdf2txt | head -n 30
pdf2txt:
total 0
drwxr-xr-x+ 5 aho staff 170 Feb 13 20:13 pdf2txt/
-rw-r--r--+ 1 aho staff 0 Feb 13 19:43 test1.txt
-rw-r--r--+ 1 aho staff 0 Feb 13 19:43 test2.txt

pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/
-rw-r--r--+ 1 aho staff 0 Feb 13 20:13 test1.txt
-rw-r--r--+ 1 aho staff 0 Feb 13 20:13 test2.txt

pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0





share|improve this answer
























  • Thats basically what I am getting, it just keeps going and going and going till that 'name too long' error. I shall try the command and update the post tonight

    – madmiddle
    12 hours ago














8












8








8







I think telcoM's answer sniffs around the primary cause: It's likely to involve a symlink, just a different one.



Based on my experimentation, there's one set of circumstances that fits the bill:





  • Test_folder is a symlink to pdf2txt, and

  • the OP is using stock macOS cp, which has a BSD heritage


This sort of symlink defeats macOS cp's cycle detection. (GNU cp, as would've been installed by Homebrew or some other package manager, doesn't follow symlinks by default, even when copying recursively.)



Here's a demo, tested on macOS High Sierra:



$ ln -s pdf2txt Test_folder

$ ls -lAF Test_folder
lrwxr-xr-x 1 aho staff 7 Feb 13 20:13 Test_folder -> pdf2txt/

$ /bin/cp -r pdf2txt Test_folder
cp: Test_folder/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt: name too long (not copied)
cp: Test_folder/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt: name too long (not copied)

# Let's just look at the first 30 lines of a recursive ls
# (And yes, we're looking at pdf2txt)
$ ls -lRAF pdf2txt | head -n 30
pdf2txt:
total 0
drwxr-xr-x+ 5 aho staff 170 Feb 13 20:13 pdf2txt/
-rw-r--r--+ 1 aho staff 0 Feb 13 19:43 test1.txt
-rw-r--r--+ 1 aho staff 0 Feb 13 19:43 test2.txt

pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/
-rw-r--r--+ 1 aho staff 0 Feb 13 20:13 test1.txt
-rw-r--r--+ 1 aho staff 0 Feb 13 20:13 test2.txt

pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0





share|improve this answer













I think telcoM's answer sniffs around the primary cause: It's likely to involve a symlink, just a different one.



Based on my experimentation, there's one set of circumstances that fits the bill:





  • Test_folder is a symlink to pdf2txt, and

  • the OP is using stock macOS cp, which has a BSD heritage


This sort of symlink defeats macOS cp's cycle detection. (GNU cp, as would've been installed by Homebrew or some other package manager, doesn't follow symlinks by default, even when copying recursively.)



Here's a demo, tested on macOS High Sierra:



$ ln -s pdf2txt Test_folder

$ ls -lAF Test_folder
lrwxr-xr-x 1 aho staff 7 Feb 13 20:13 Test_folder -> pdf2txt/

$ /bin/cp -r pdf2txt Test_folder
cp: Test_folder/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt: name too long (not copied)
cp: Test_folder/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt: name too long (not copied)

# Let's just look at the first 30 lines of a recursive ls
# (And yes, we're looking at pdf2txt)
$ ls -lRAF pdf2txt | head -n 30
pdf2txt:
total 0
drwxr-xr-x+ 5 aho staff 170 Feb 13 20:13 pdf2txt/
-rw-r--r--+ 1 aho staff 0 Feb 13 19:43 test1.txt
-rw-r--r--+ 1 aho staff 0 Feb 13 19:43 test2.txt

pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/
-rw-r--r--+ 1 aho staff 0 Feb 13 20:13 test1.txt
-rw-r--r--+ 1 aho staff 0 Feb 13 20:13 test2.txt

pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0
drwxr-xr-x+ 3 aho staff 102 Feb 13 20:13 pdf2txt/

pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt/pdf2txt:
total 0






share|improve this answer












share|improve this answer



share|improve this answer










answered 13 hours ago









AdrianAdrian

90157




90157













  • Thats basically what I am getting, it just keeps going and going and going till that 'name too long' error. I shall try the command and update the post tonight

    – madmiddle
    12 hours ago



















  • Thats basically what I am getting, it just keeps going and going and going till that 'name too long' error. I shall try the command and update the post tonight

    – madmiddle
    12 hours ago

















Thats basically what I am getting, it just keeps going and going and going till that 'name too long' error. I shall try the command and update the post tonight

– madmiddle
12 hours ago





Thats basically what I am getting, it just keeps going and going and going till that 'name too long' error. I shall try the command and update the post tonight

– madmiddle
12 hours ago













5














Is there a symbolic link /Volumes/Mac_Storage/pdf2txt/pdf2txt pointing to .?



Run ls -l /Volumes/Mac_Storage/pdf2txt to check.



If you see a line like this:



lrwxrwxrwx 1 madmiddle madmiddle 1 Feb 12 12:34 pdf2txt -> .


... then that is the cause.



The command to create such a link would be ln -s . pdf2txt, which might be fairly easy to happen accidentally as a result of a typo.






share|improve this answer
























  • I'll have to read up on symbolic link is as I have no idea what that means. I shall run it tonight and get back to you.

    – madmiddle
    13 hours ago











  • Highly unlikely to be the case. macOS stock (BSD) cp stops the copy dead with the error cp: pdf2txt/pdf2txt: directory causes a cycle, which a Homebrew-installed (GNU) cp copies the directory correctly because it doesn't follow symlinks by default.

    – Adrian
    13 hours ago
















5














Is there a symbolic link /Volumes/Mac_Storage/pdf2txt/pdf2txt pointing to .?



Run ls -l /Volumes/Mac_Storage/pdf2txt to check.



If you see a line like this:



lrwxrwxrwx 1 madmiddle madmiddle 1 Feb 12 12:34 pdf2txt -> .


... then that is the cause.



The command to create such a link would be ln -s . pdf2txt, which might be fairly easy to happen accidentally as a result of a typo.






share|improve this answer
























  • I'll have to read up on symbolic link is as I have no idea what that means. I shall run it tonight and get back to you.

    – madmiddle
    13 hours ago











  • Highly unlikely to be the case. macOS stock (BSD) cp stops the copy dead with the error cp: pdf2txt/pdf2txt: directory causes a cycle, which a Homebrew-installed (GNU) cp copies the directory correctly because it doesn't follow symlinks by default.

    – Adrian
    13 hours ago














5












5








5







Is there a symbolic link /Volumes/Mac_Storage/pdf2txt/pdf2txt pointing to .?



Run ls -l /Volumes/Mac_Storage/pdf2txt to check.



If you see a line like this:



lrwxrwxrwx 1 madmiddle madmiddle 1 Feb 12 12:34 pdf2txt -> .


... then that is the cause.



The command to create such a link would be ln -s . pdf2txt, which might be fairly easy to happen accidentally as a result of a typo.






share|improve this answer













Is there a symbolic link /Volumes/Mac_Storage/pdf2txt/pdf2txt pointing to .?



Run ls -l /Volumes/Mac_Storage/pdf2txt to check.



If you see a line like this:



lrwxrwxrwx 1 madmiddle madmiddle 1 Feb 12 12:34 pdf2txt -> .


... then that is the cause.



The command to create such a link would be ln -s . pdf2txt, which might be fairly easy to happen accidentally as a result of a typo.







share|improve this answer












share|improve this answer



share|improve this answer










answered 13 hours ago









telcoMtelcoM

17.3k12347




17.3k12347













  • I'll have to read up on symbolic link is as I have no idea what that means. I shall run it tonight and get back to you.

    – madmiddle
    13 hours ago











  • Highly unlikely to be the case. macOS stock (BSD) cp stops the copy dead with the error cp: pdf2txt/pdf2txt: directory causes a cycle, which a Homebrew-installed (GNU) cp copies the directory correctly because it doesn't follow symlinks by default.

    – Adrian
    13 hours ago



















  • I'll have to read up on symbolic link is as I have no idea what that means. I shall run it tonight and get back to you.

    – madmiddle
    13 hours ago











  • Highly unlikely to be the case. macOS stock (BSD) cp stops the copy dead with the error cp: pdf2txt/pdf2txt: directory causes a cycle, which a Homebrew-installed (GNU) cp copies the directory correctly because it doesn't follow symlinks by default.

    – Adrian
    13 hours ago

















I'll have to read up on symbolic link is as I have no idea what that means. I shall run it tonight and get back to you.

– madmiddle
13 hours ago





I'll have to read up on symbolic link is as I have no idea what that means. I shall run it tonight and get back to you.

– madmiddle
13 hours ago













Highly unlikely to be the case. macOS stock (BSD) cp stops the copy dead with the error cp: pdf2txt/pdf2txt: directory causes a cycle, which a Homebrew-installed (GNU) cp copies the directory correctly because it doesn't follow symlinks by default.

– Adrian
13 hours ago





Highly unlikely to be the case. macOS stock (BSD) cp stops the copy dead with the error cp: pdf2txt/pdf2txt: directory causes a cycle, which a Homebrew-installed (GNU) cp copies the directory correctly because it doesn't follow symlinks by default.

– Adrian
13 hours ago


















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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f500379%2fcp-works-differently-on-a-mac%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

Paul Cézanne

UIScrollView CustomStickyHeader Resize height generates problems when scroll is too fast

Angular material date-picker (MatDatepicker) auto completes the date on focus out