Mac unix backup directory cannot be listed from command line

The name of the pictureThe name of the pictureThe name of the pictureClash 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" works


  • ls does not

And yet I can verify this path exists and even view the contents through the Mac "finder" UI.







share|improve this question






















  • 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














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" works


  • ls does not

And yet I can verify this path exists and even view the contents through the Mac "finder" UI.







share|improve this question






















  • 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












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" works


  • ls does not

And yet I can verify this path exists and even view the contents through the Mac "finder" UI.







share|improve this question














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" works


  • ls does not

And yet I can verify this path exists and even view the contents through the Mac "finder" UI.









share|improve this question













share|improve this question




share|improve this question








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
















  • 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










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:



  1. ls "Volumes/My Backup Dr/Backups.backupdb/User’s MacBook Pro/2018-03-10-011602"

  2. 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.






share|improve this answer






















    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',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    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%2f437064%2fmac-unix-backup-directory-cannot-be-listed-from-command-line%23new-answer', 'question_page');

    );

    Post as a guest






























    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:



    1. ls "Volumes/My Backup Dr/Backups.backupdb/User’s MacBook Pro/2018-03-10-011602"

    2. 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.






    share|improve this answer


























      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:



      1. ls "Volumes/My Backup Dr/Backups.backupdb/User’s MacBook Pro/2018-03-10-011602"

      2. 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.






      share|improve this answer
























        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:



        1. ls "Volumes/My Backup Dr/Backups.backupdb/User’s MacBook Pro/2018-03-10-011602"

        2. 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.






        share|improve this answer














        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:



        1. ls "Volumes/My Backup Dr/Backups.backupdb/User’s MacBook Pro/2018-03-10-011602"

        2. 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.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 11 at 16:44

























        answered Apr 11 at 16:18









        TMWP

        1065




        1065






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            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













































































            Popular posts from this blog

            Peggy Mitchell

            Palaiologos

            The Forum (Inglewood, California)