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
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"works
And yet I can verify this path exists and even view the contents through the Mac "finder" UI.