Mac unix backup directory cannot be listed from command line

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
Posting this to learn and I know this violates UNIX best practice or even just normal common sense, but I guess that's what Macintosh computers do sometimes. I have a backup drive with backup directories that look like this:
>$ tmutil listbackups
/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-01-18-143624
/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-10-011602
/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-13-014248
/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-04-10-224116
From the command line, if I try to use ls to list the contents of one of these, I am running into trouble because of the '. Note that I tried suggestions found on other posts concerning copying and pasting the path to ensure it is using the same apostrophe, substituting *. and even tried escaping it. But I get directory unknown error every time. I also tried putting the whole path in double quotes and also just the folder in the path with the apostrophe in double quotes. Still no luck.
What is the correct syntax to get a listing of the directory given above?
How about to use a wild-card in that ls command variant to list what is in all directories from 2018-03*?
On a final note: best solution would probably be to lose the apostrophe, but this is auto-created by Macintosh during backups. What was Apple thinking?
Updates: to add further confusion to this question
sudo tmutil delete "/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-10-011602"workslsdoes not
And yet I can verify this path exists and even view the contents through the Mac "finder" UI.
ls macintosh
add a comment |Â
up vote
1
down vote
favorite
Posting this to learn and I know this violates UNIX best practice or even just normal common sense, but I guess that's what Macintosh computers do sometimes. I have a backup drive with backup directories that look like this:
>$ tmutil listbackups
/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-01-18-143624
/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-10-011602
/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-13-014248
/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-04-10-224116
From the command line, if I try to use ls to list the contents of one of these, I am running into trouble because of the '. Note that I tried suggestions found on other posts concerning copying and pasting the path to ensure it is using the same apostrophe, substituting *. and even tried escaping it. But I get directory unknown error every time. I also tried putting the whole path in double quotes and also just the folder in the path with the apostrophe in double quotes. Still no luck.
What is the correct syntax to get a listing of the directory given above?
How about to use a wild-card in that ls command variant to list what is in all directories from 2018-03*?
On a final note: best solution would probably be to lose the apostrophe, but this is auto-created by Macintosh during backups. What was Apple thinking?
Updates: to add further confusion to this question
sudo tmutil delete "/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-10-011602"workslsdoes not
And yet I can verify this path exists and even view the contents through the Mac "finder" UI.
ls macintosh
nope. Tried this too. But just tried again after reading your comment. Edited question to include tests with double quote but I think my edit crossed with your answer.
â TMWP
Apr 11 at 15:55
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Posting this to learn and I know this violates UNIX best practice or even just normal common sense, but I guess that's what Macintosh computers do sometimes. I have a backup drive with backup directories that look like this:
>$ tmutil listbackups
/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-01-18-143624
/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-10-011602
/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-13-014248
/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-04-10-224116
From the command line, if I try to use ls to list the contents of one of these, I am running into trouble because of the '. Note that I tried suggestions found on other posts concerning copying and pasting the path to ensure it is using the same apostrophe, substituting *. and even tried escaping it. But I get directory unknown error every time. I also tried putting the whole path in double quotes and also just the folder in the path with the apostrophe in double quotes. Still no luck.
What is the correct syntax to get a listing of the directory given above?
How about to use a wild-card in that ls command variant to list what is in all directories from 2018-03*?
On a final note: best solution would probably be to lose the apostrophe, but this is auto-created by Macintosh during backups. What was Apple thinking?
Updates: to add further confusion to this question
sudo tmutil delete "/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-10-011602"workslsdoes not
And yet I can verify this path exists and even view the contents through the Mac "finder" UI.
ls macintosh
Posting this to learn and I know this violates UNIX best practice or even just normal common sense, but I guess that's what Macintosh computers do sometimes. I have a backup drive with backup directories that look like this:
>$ tmutil listbackups
/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-01-18-143624
/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-10-011602
/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-13-014248
/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-04-10-224116
From the command line, if I try to use ls to list the contents of one of these, I am running into trouble because of the '. Note that I tried suggestions found on other posts concerning copying and pasting the path to ensure it is using the same apostrophe, substituting *. and even tried escaping it. But I get directory unknown error every time. I also tried putting the whole path in double quotes and also just the folder in the path with the apostrophe in double quotes. Still no luck.
What is the correct syntax to get a listing of the directory given above?
How about to use a wild-card in that ls command variant to list what is in all directories from 2018-03*?
On a final note: best solution would probably be to lose the apostrophe, but this is auto-created by Macintosh during backups. What was Apple thinking?
Updates: to add further confusion to this question
sudo tmutil delete "/Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-10-011602"workslsdoes not
And yet I can verify this path exists and even view the contents through the Mac "finder" UI.
ls macintosh
edited Apr 11 at 16:10
asked Apr 11 at 15:50
TMWP
1065
1065
nope. Tried this too. But just tried again after reading your comment. Edited question to include tests with double quote but I think my edit crossed with your answer.
â TMWP
Apr 11 at 15:55
add a comment |Â
nope. Tried this too. But just tried again after reading your comment. Edited question to include tests with double quote but I think my edit crossed with your answer.
â TMWP
Apr 11 at 15:55
nope. Tried this too. But just tried again after reading your comment. Edited question to include tests with double quote but I think my edit crossed with your answer.
â TMWP
Apr 11 at 15:55
nope. Tried this too. But just tried again after reading your comment. Edited question to include tests with double quote but I think my edit crossed with your answer.
â TMWP
Apr 11 at 15:55
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
Apologies to the user who posted about double-quotes. Further testing reveals this is not a UNIX issue but possibly a Mac issue. Somehow, copying and pasting the whole path into the command and wrapping it in double quotes produced something that looked identical to the original but I am now thinking that somehow it must have been different.
If I pasted the path in chunks and tested each chunk, building up to a path that matched the original, then the problem went away. Proper UNIX syntax to answer both questions (list the folder and use a wild card as in the question example), the answers would look like this:
ls "Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-10-011602"ls "Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-"*
The second example would list all contents from the march folders on my backup drive. Note that the * has to be outside the double-quoted directory pattern.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Apologies to the user who posted about double-quotes. Further testing reveals this is not a UNIX issue but possibly a Mac issue. Somehow, copying and pasting the whole path into the command and wrapping it in double quotes produced something that looked identical to the original but I am now thinking that somehow it must have been different.
If I pasted the path in chunks and tested each chunk, building up to a path that matched the original, then the problem went away. Proper UNIX syntax to answer both questions (list the folder and use a wild card as in the question example), the answers would look like this:
ls "Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-10-011602"ls "Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-"*
The second example would list all contents from the march folders on my backup drive. Note that the * has to be outside the double-quoted directory pattern.
add a comment |Â
up vote
0
down vote
accepted
Apologies to the user who posted about double-quotes. Further testing reveals this is not a UNIX issue but possibly a Mac issue. Somehow, copying and pasting the whole path into the command and wrapping it in double quotes produced something that looked identical to the original but I am now thinking that somehow it must have been different.
If I pasted the path in chunks and tested each chunk, building up to a path that matched the original, then the problem went away. Proper UNIX syntax to answer both questions (list the folder and use a wild card as in the question example), the answers would look like this:
ls "Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-10-011602"ls "Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-"*
The second example would list all contents from the march folders on my backup drive. Note that the * has to be outside the double-quoted directory pattern.
add a comment |Â
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Apologies to the user who posted about double-quotes. Further testing reveals this is not a UNIX issue but possibly a Mac issue. Somehow, copying and pasting the whole path into the command and wrapping it in double quotes produced something that looked identical to the original but I am now thinking that somehow it must have been different.
If I pasted the path in chunks and tested each chunk, building up to a path that matched the original, then the problem went away. Proper UNIX syntax to answer both questions (list the folder and use a wild card as in the question example), the answers would look like this:
ls "Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-10-011602"ls "Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-"*
The second example would list all contents from the march folders on my backup drive. Note that the * has to be outside the double-quoted directory pattern.
Apologies to the user who posted about double-quotes. Further testing reveals this is not a UNIX issue but possibly a Mac issue. Somehow, copying and pasting the whole path into the command and wrapping it in double quotes produced something that looked identical to the original but I am now thinking that somehow it must have been different.
If I pasted the path in chunks and tested each chunk, building up to a path that matched the original, then the problem went away. Proper UNIX syntax to answer both questions (list the folder and use a wild card as in the question example), the answers would look like this:
ls "Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-10-011602"ls "Volumes/My Backup Dr/Backups.backupdb/UserâÂÂs MacBook Pro/2018-03-"*
The second example would list all contents from the march folders on my backup drive. Note that the * has to be outside the double-quoted directory pattern.
edited Apr 11 at 16:44
answered Apr 11 at 16:18
TMWP
1065
1065
add a comment |Â
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f437064%2fmac-unix-backup-directory-cannot-be-listed-from-command-line%23new-answer', 'question_page');
);
Post as a guest
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
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
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
nope. Tried this too. But just tried again after reading your comment. Edited question to include tests with double quote but I think my edit crossed with your answer.
â TMWP
Apr 11 at 15:55