Can't cd into directory with space in its name, even with quotes or escaping











up vote
0
down vote

favorite












In a bash shell on a MacOS machine, I can see by typing ls that there is a director Application Support:



$ ls
Accounts FontCollections PreferencePanes
Application Scripts Fonts Preferences
Application Support GameKit Printers
Assistant Google PubSub
Assistants Group Containers Safari
Audio IdentityServices SafariSafeBrowsing
Caches Input Methods Saved Application State
Calendars Internet Plug-Ins Screen Savers
CallServices Keyboard Services
ColorPickers Keyboard Layouts Sharing
Colors KeyboardServices Sounds
Compositions Keychains Spelling
Containers LanguageModeling Suggestions
Cookies LaunchAgents SyncedPreferences
CoreFollowUp Library VirtualBox
Developer Logs Voices
Dictionaries Mail WebKit
F5Networks Messages com.apple.internal.ck
Family Metadata iMovie
Favorites Mobile Documents
FileProvider Passes


However, if I trying to cd into this directory using either quotes or escape characters as described in How to cd to a directory that contains a space in its name?, I still get an error:



LM-SJN-21018636:Library kupeek$ cd "Application Support"
-bash: cd: Application: No such file or directory
LM-SJN-21018636:Library kupeek$ cd Application Support
-bash: cd: Application: No such file or directory


It seems like bash is not 'picking up' the quotes or escape characters and is instead looking for a directory called "Application". Any ideas why this is not working?










share|improve this question




















  • 2




    Perhaps you have an alias or similar for cd that is badly written. What does command -v cd print?
    – meuh
    Nov 18 at 19:22






  • 2




    I would suspect a poorly written function. And I think command -v cd from the first comment should be command -V cd (capital V); type -a cd should also work.
    – Kamil Maciorowski
    Nov 18 at 19:27






  • 1




    What happens if you "autofill" it with the Tab-key? Same error?
    – Aulis Ronkainen
    Nov 18 at 19:45















up vote
0
down vote

favorite












In a bash shell on a MacOS machine, I can see by typing ls that there is a director Application Support:



$ ls
Accounts FontCollections PreferencePanes
Application Scripts Fonts Preferences
Application Support GameKit Printers
Assistant Google PubSub
Assistants Group Containers Safari
Audio IdentityServices SafariSafeBrowsing
Caches Input Methods Saved Application State
Calendars Internet Plug-Ins Screen Savers
CallServices Keyboard Services
ColorPickers Keyboard Layouts Sharing
Colors KeyboardServices Sounds
Compositions Keychains Spelling
Containers LanguageModeling Suggestions
Cookies LaunchAgents SyncedPreferences
CoreFollowUp Library VirtualBox
Developer Logs Voices
Dictionaries Mail WebKit
F5Networks Messages com.apple.internal.ck
Family Metadata iMovie
Favorites Mobile Documents
FileProvider Passes


However, if I trying to cd into this directory using either quotes or escape characters as described in How to cd to a directory that contains a space in its name?, I still get an error:



LM-SJN-21018636:Library kupeek$ cd "Application Support"
-bash: cd: Application: No such file or directory
LM-SJN-21018636:Library kupeek$ cd Application Support
-bash: cd: Application: No such file or directory


It seems like bash is not 'picking up' the quotes or escape characters and is instead looking for a directory called "Application". Any ideas why this is not working?










share|improve this question




















  • 2




    Perhaps you have an alias or similar for cd that is badly written. What does command -v cd print?
    – meuh
    Nov 18 at 19:22






  • 2




    I would suspect a poorly written function. And I think command -v cd from the first comment should be command -V cd (capital V); type -a cd should also work.
    – Kamil Maciorowski
    Nov 18 at 19:27






  • 1




    What happens if you "autofill" it with the Tab-key? Same error?
    – Aulis Ronkainen
    Nov 18 at 19:45













up vote
0
down vote

favorite









up vote
0
down vote

favorite











In a bash shell on a MacOS machine, I can see by typing ls that there is a director Application Support:



$ ls
Accounts FontCollections PreferencePanes
Application Scripts Fonts Preferences
Application Support GameKit Printers
Assistant Google PubSub
Assistants Group Containers Safari
Audio IdentityServices SafariSafeBrowsing
Caches Input Methods Saved Application State
Calendars Internet Plug-Ins Screen Savers
CallServices Keyboard Services
ColorPickers Keyboard Layouts Sharing
Colors KeyboardServices Sounds
Compositions Keychains Spelling
Containers LanguageModeling Suggestions
Cookies LaunchAgents SyncedPreferences
CoreFollowUp Library VirtualBox
Developer Logs Voices
Dictionaries Mail WebKit
F5Networks Messages com.apple.internal.ck
Family Metadata iMovie
Favorites Mobile Documents
FileProvider Passes


However, if I trying to cd into this directory using either quotes or escape characters as described in How to cd to a directory that contains a space in its name?, I still get an error:



LM-SJN-21018636:Library kupeek$ cd "Application Support"
-bash: cd: Application: No such file or directory
LM-SJN-21018636:Library kupeek$ cd Application Support
-bash: cd: Application: No such file or directory


It seems like bash is not 'picking up' the quotes or escape characters and is instead looking for a directory called "Application". Any ideas why this is not working?










share|improve this question















In a bash shell on a MacOS machine, I can see by typing ls that there is a director Application Support:



$ ls
Accounts FontCollections PreferencePanes
Application Scripts Fonts Preferences
Application Support GameKit Printers
Assistant Google PubSub
Assistants Group Containers Safari
Audio IdentityServices SafariSafeBrowsing
Caches Input Methods Saved Application State
Calendars Internet Plug-Ins Screen Savers
CallServices Keyboard Services
ColorPickers Keyboard Layouts Sharing
Colors KeyboardServices Sounds
Compositions Keychains Spelling
Containers LanguageModeling Suggestions
Cookies LaunchAgents SyncedPreferences
CoreFollowUp Library VirtualBox
Developer Logs Voices
Dictionaries Mail WebKit
F5Networks Messages com.apple.internal.ck
Family Metadata iMovie
Favorites Mobile Documents
FileProvider Passes


However, if I trying to cd into this directory using either quotes or escape characters as described in How to cd to a directory that contains a space in its name?, I still get an error:



LM-SJN-21018636:Library kupeek$ cd "Application Support"
-bash: cd: Application: No such file or directory
LM-SJN-21018636:Library kupeek$ cd Application Support
-bash: cd: Application: No such file or directory


It seems like bash is not 'picking up' the quotes or escape characters and is instead looking for a directory called "Application". Any ideas why this is not working?







macos command-line bash shell






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 at 2:17









jimtut

658413




658413










asked Nov 18 at 19:13









Kurt Peek

1135




1135








  • 2




    Perhaps you have an alias or similar for cd that is badly written. What does command -v cd print?
    – meuh
    Nov 18 at 19:22






  • 2




    I would suspect a poorly written function. And I think command -v cd from the first comment should be command -V cd (capital V); type -a cd should also work.
    – Kamil Maciorowski
    Nov 18 at 19:27






  • 1




    What happens if you "autofill" it with the Tab-key? Same error?
    – Aulis Ronkainen
    Nov 18 at 19:45














  • 2




    Perhaps you have an alias or similar for cd that is badly written. What does command -v cd print?
    – meuh
    Nov 18 at 19:22






  • 2




    I would suspect a poorly written function. And I think command -v cd from the first comment should be command -V cd (capital V); type -a cd should also work.
    – Kamil Maciorowski
    Nov 18 at 19:27






  • 1




    What happens if you "autofill" it with the Tab-key? Same error?
    – Aulis Ronkainen
    Nov 18 at 19:45








2




2




Perhaps you have an alias or similar for cd that is badly written. What does command -v cd print?
– meuh
Nov 18 at 19:22




Perhaps you have an alias or similar for cd that is badly written. What does command -v cd print?
– meuh
Nov 18 at 19:22




2




2




I would suspect a poorly written function. And I think command -v cd from the first comment should be command -V cd (capital V); type -a cd should also work.
– Kamil Maciorowski
Nov 18 at 19:27




I would suspect a poorly written function. And I think command -v cd from the first comment should be command -V cd (capital V); type -a cd should also work.
– Kamil Maciorowski
Nov 18 at 19:27




1




1




What happens if you "autofill" it with the Tab-key? Same error?
– Aulis Ronkainen
Nov 18 at 19:45




What happens if you "autofill" it with the Tab-key? Same error?
– Aulis Ronkainen
Nov 18 at 19:45










5 Answers
5






active

oldest

votes

















up vote
5
down vote



accepted










Your cd may be a poorly defined function or alias. Run type -a cd to find out.



A possible alias is explained in this other answer. My answer concentrates on shell functions.



For example if the function used





  • command cd $* (command builtin explained here) or


  • command cd $@ or

  • command cd $1


instead of correct





  • command cd "$@" or


  • command cd "$1" (not as good as the above, still not fatal)


and your Bash didn't throw too many arguments (pre-4.4 version, see this question), the behavior would be exactly as you described because Application Support being a single argument to the function would undergo word splitting inside the function itself, so command cd would see Application as its first argument.



If your cd is indeed a poorly defined function, you should track the place where it is defined and fix it. An ad hoc solution would be to add the command word before cd, like this:



command cd "Application Support"


or



command cd Application Support


(This will also work if alias is the culprit).






share|improve this answer






























    up vote
    1
    down vote













    Try using more than one set of quotes,



    e.g. put the name in single quotes within double quotes:



    cd "'Application Support'"


    "An argument enclosed in double quotes presents itself as a single word, even if it contains whitespace separators." Advanced Bash-Scripting Guide



    Using two sets of quotes (quotes within quotes) is a viable workaround, assuming that the problem here is that the original cd command has been aliased. The following definition



    alias cd='eval command cd'


    would reproduce the problem reported here (in pre-4.4 version of Bash, see this answer). It happens that eval parses the command line for the second time and, on the first pass of parsing, one layer of quoting is removed. Using two sets of quotes works because, removed the first set of quotes, eval will pass the argument with the second set of quotes to cd.



    If such alias is the case, the best solution is to fix it in the first place.






    share|improve this answer























    • Simple. I believe the problem here is that the original "cd" command has been aliased. The alias gets the path string as argument and it gets it correctly if you put the first set of quotes. Then it passes it to "cd" but it goes there without quotes and fails. If you put two sets of quotes, the alias gets the string with the first set and then it passes it to "cd" with the second set of quotes and... Magic, it works!
      – GiopperOne
      Nov 18 at 23:32










    • Thanks for your suggestion, I edited my answer and added a reference. I don't have to explain here how to modify a "cd" alias, that would be off-topic. I am answering the question "Any ideas why this is not working?", the answer is because using single quotes alone. Put it within double quotes and it will work.
      – GiopperOne
      Nov 19 at 5:23










    • Good job! Thank you for cooperation.
      – Kamil Maciorowski
      Nov 19 at 7:00


















    up vote
    0
    down vote













    There could be more blanks or other non-printable chars that you don't see. Try cd Application*Scrip* or similar.






    share|improve this answer

















    • 1




      This could be it in some other case, but not in this particular one. Note the message is -bash: cd: Application: No such file or directory, not -bash: cd: Application Support: No such file or directory. The command doesn't see the whole argument string in the first place.
      – Kamil Maciorowski
      Nov 18 at 19:38


















    up vote
    0
    down vote













    IF your cd isn't a weird alias, then I'd just use TAB with bash's autocomplete (if it's enabled) to fill a working format for you.



    Typing



    cd ApTAB



    looks like it should autofill to something like



    cd Application S


    (If you do have a weird cd alias, then appending Kamil's answer of typing command cd A... should work with TAB's too)



    and then wait for you to type more of the wanted name (followed by anoter TAB to autocomplete the rest). Or just typing TAB once or twice more will display your available options.



    (I'd also not use plain ls, but ls -la or maybe ls -1 instead to see only one entry per line, your ls output isn't clear)






    share|improve this answer





















    • This may be a good advice in a general case (i.e. for future users with similar problems) but I doubt it will immediately help the OP. Note the message is Application: No such file or directory, not Application Support: No such file or directory. If the directory name in the command line simply didn't match the actual name, cd would still comply about the whole argument being wrong. I don't downvote answers that may apply to very similar problems, still I'm noting they don't entirely fit the OP's issue and they cannot explain the root of it.
      – Kamil Maciorowski
      Nov 19 at 9:35










    • I thought so too, but it's a little annoying when the title doesn't fully match the real problem ("My cd is broken"), and tab complete was only mentioned briefly in a comment, so a fuller answer for the "title problem" seemed appropriate.
      – Xen2050
      Nov 19 at 11:59




















    up vote
    -1
    down vote













    It's because you're missing by one word. Try using:



    cd "Application Support GameKit"





    share|improve this answer





















    • I'm repeating myself: This could be it in some other case, but not in this particular one. Note the message is -bash: cd: Application: No such file or directory, not -bash: cd: Application Support: No such file or directory. The command doesn't see the whole argument string in the first place.
      – Kamil Maciorowski
      Nov 18 at 19:39










    • You mis-read the OP; they're 2 different columns
      – Tetsujin
      Nov 18 at 19:39











    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    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: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    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%2fsuperuser.com%2fquestions%2f1376500%2fcant-cd-into-directory-with-space-in-its-name-even-with-quotes-or-escaping%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    5 Answers
    5






    active

    oldest

    votes








    5 Answers
    5






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    5
    down vote



    accepted










    Your cd may be a poorly defined function or alias. Run type -a cd to find out.



    A possible alias is explained in this other answer. My answer concentrates on shell functions.



    For example if the function used





    • command cd $* (command builtin explained here) or


    • command cd $@ or

    • command cd $1


    instead of correct





    • command cd "$@" or


    • command cd "$1" (not as good as the above, still not fatal)


    and your Bash didn't throw too many arguments (pre-4.4 version, see this question), the behavior would be exactly as you described because Application Support being a single argument to the function would undergo word splitting inside the function itself, so command cd would see Application as its first argument.



    If your cd is indeed a poorly defined function, you should track the place where it is defined and fix it. An ad hoc solution would be to add the command word before cd, like this:



    command cd "Application Support"


    or



    command cd Application Support


    (This will also work if alias is the culprit).






    share|improve this answer



























      up vote
      5
      down vote



      accepted










      Your cd may be a poorly defined function or alias. Run type -a cd to find out.



      A possible alias is explained in this other answer. My answer concentrates on shell functions.



      For example if the function used





      • command cd $* (command builtin explained here) or


      • command cd $@ or

      • command cd $1


      instead of correct





      • command cd "$@" or


      • command cd "$1" (not as good as the above, still not fatal)


      and your Bash didn't throw too many arguments (pre-4.4 version, see this question), the behavior would be exactly as you described because Application Support being a single argument to the function would undergo word splitting inside the function itself, so command cd would see Application as its first argument.



      If your cd is indeed a poorly defined function, you should track the place where it is defined and fix it. An ad hoc solution would be to add the command word before cd, like this:



      command cd "Application Support"


      or



      command cd Application Support


      (This will also work if alias is the culprit).






      share|improve this answer

























        up vote
        5
        down vote



        accepted







        up vote
        5
        down vote



        accepted






        Your cd may be a poorly defined function or alias. Run type -a cd to find out.



        A possible alias is explained in this other answer. My answer concentrates on shell functions.



        For example if the function used





        • command cd $* (command builtin explained here) or


        • command cd $@ or

        • command cd $1


        instead of correct





        • command cd "$@" or


        • command cd "$1" (not as good as the above, still not fatal)


        and your Bash didn't throw too many arguments (pre-4.4 version, see this question), the behavior would be exactly as you described because Application Support being a single argument to the function would undergo word splitting inside the function itself, so command cd would see Application as its first argument.



        If your cd is indeed a poorly defined function, you should track the place where it is defined and fix it. An ad hoc solution would be to add the command word before cd, like this:



        command cd "Application Support"


        or



        command cd Application Support


        (This will also work if alias is the culprit).






        share|improve this answer














        Your cd may be a poorly defined function or alias. Run type -a cd to find out.



        A possible alias is explained in this other answer. My answer concentrates on shell functions.



        For example if the function used





        • command cd $* (command builtin explained here) or


        • command cd $@ or

        • command cd $1


        instead of correct





        • command cd "$@" or


        • command cd "$1" (not as good as the above, still not fatal)


        and your Bash didn't throw too many arguments (pre-4.4 version, see this question), the behavior would be exactly as you described because Application Support being a single argument to the function would undergo word splitting inside the function itself, so command cd would see Application as its first argument.



        If your cd is indeed a poorly defined function, you should track the place where it is defined and fix it. An ad hoc solution would be to add the command word before cd, like this:



        command cd "Application Support"


        or



        command cd Application Support


        (This will also work if alias is the culprit).







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 19 at 7:04

























        answered Nov 18 at 19:56









        Kamil Maciorowski

        22.8k155072




        22.8k155072
























            up vote
            1
            down vote













            Try using more than one set of quotes,



            e.g. put the name in single quotes within double quotes:



            cd "'Application Support'"


            "An argument enclosed in double quotes presents itself as a single word, even if it contains whitespace separators." Advanced Bash-Scripting Guide



            Using two sets of quotes (quotes within quotes) is a viable workaround, assuming that the problem here is that the original cd command has been aliased. The following definition



            alias cd='eval command cd'


            would reproduce the problem reported here (in pre-4.4 version of Bash, see this answer). It happens that eval parses the command line for the second time and, on the first pass of parsing, one layer of quoting is removed. Using two sets of quotes works because, removed the first set of quotes, eval will pass the argument with the second set of quotes to cd.



            If such alias is the case, the best solution is to fix it in the first place.






            share|improve this answer























            • Simple. I believe the problem here is that the original "cd" command has been aliased. The alias gets the path string as argument and it gets it correctly if you put the first set of quotes. Then it passes it to "cd" but it goes there without quotes and fails. If you put two sets of quotes, the alias gets the string with the first set and then it passes it to "cd" with the second set of quotes and... Magic, it works!
              – GiopperOne
              Nov 18 at 23:32










            • Thanks for your suggestion, I edited my answer and added a reference. I don't have to explain here how to modify a "cd" alias, that would be off-topic. I am answering the question "Any ideas why this is not working?", the answer is because using single quotes alone. Put it within double quotes and it will work.
              – GiopperOne
              Nov 19 at 5:23










            • Good job! Thank you for cooperation.
              – Kamil Maciorowski
              Nov 19 at 7:00















            up vote
            1
            down vote













            Try using more than one set of quotes,



            e.g. put the name in single quotes within double quotes:



            cd "'Application Support'"


            "An argument enclosed in double quotes presents itself as a single word, even if it contains whitespace separators." Advanced Bash-Scripting Guide



            Using two sets of quotes (quotes within quotes) is a viable workaround, assuming that the problem here is that the original cd command has been aliased. The following definition



            alias cd='eval command cd'


            would reproduce the problem reported here (in pre-4.4 version of Bash, see this answer). It happens that eval parses the command line for the second time and, on the first pass of parsing, one layer of quoting is removed. Using two sets of quotes works because, removed the first set of quotes, eval will pass the argument with the second set of quotes to cd.



            If such alias is the case, the best solution is to fix it in the first place.






            share|improve this answer























            • Simple. I believe the problem here is that the original "cd" command has been aliased. The alias gets the path string as argument and it gets it correctly if you put the first set of quotes. Then it passes it to "cd" but it goes there without quotes and fails. If you put two sets of quotes, the alias gets the string with the first set and then it passes it to "cd" with the second set of quotes and... Magic, it works!
              – GiopperOne
              Nov 18 at 23:32










            • Thanks for your suggestion, I edited my answer and added a reference. I don't have to explain here how to modify a "cd" alias, that would be off-topic. I am answering the question "Any ideas why this is not working?", the answer is because using single quotes alone. Put it within double quotes and it will work.
              – GiopperOne
              Nov 19 at 5:23










            • Good job! Thank you for cooperation.
              – Kamil Maciorowski
              Nov 19 at 7:00













            up vote
            1
            down vote










            up vote
            1
            down vote









            Try using more than one set of quotes,



            e.g. put the name in single quotes within double quotes:



            cd "'Application Support'"


            "An argument enclosed in double quotes presents itself as a single word, even if it contains whitespace separators." Advanced Bash-Scripting Guide



            Using two sets of quotes (quotes within quotes) is a viable workaround, assuming that the problem here is that the original cd command has been aliased. The following definition



            alias cd='eval command cd'


            would reproduce the problem reported here (in pre-4.4 version of Bash, see this answer). It happens that eval parses the command line for the second time and, on the first pass of parsing, one layer of quoting is removed. Using two sets of quotes works because, removed the first set of quotes, eval will pass the argument with the second set of quotes to cd.



            If such alias is the case, the best solution is to fix it in the first place.






            share|improve this answer














            Try using more than one set of quotes,



            e.g. put the name in single quotes within double quotes:



            cd "'Application Support'"


            "An argument enclosed in double quotes presents itself as a single word, even if it contains whitespace separators." Advanced Bash-Scripting Guide



            Using two sets of quotes (quotes within quotes) is a viable workaround, assuming that the problem here is that the original cd command has been aliased. The following definition



            alias cd='eval command cd'


            would reproduce the problem reported here (in pre-4.4 version of Bash, see this answer). It happens that eval parses the command line for the second time and, on the first pass of parsing, one layer of quoting is removed. Using two sets of quotes works because, removed the first set of quotes, eval will pass the argument with the second set of quotes to cd.



            If such alias is the case, the best solution is to fix it in the first place.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 19 at 7:00









            Kamil Maciorowski

            22.8k155072




            22.8k155072










            answered Nov 18 at 20:12









            GiopperOne

            313




            313












            • Simple. I believe the problem here is that the original "cd" command has been aliased. The alias gets the path string as argument and it gets it correctly if you put the first set of quotes. Then it passes it to "cd" but it goes there without quotes and fails. If you put two sets of quotes, the alias gets the string with the first set and then it passes it to "cd" with the second set of quotes and... Magic, it works!
              – GiopperOne
              Nov 18 at 23:32










            • Thanks for your suggestion, I edited my answer and added a reference. I don't have to explain here how to modify a "cd" alias, that would be off-topic. I am answering the question "Any ideas why this is not working?", the answer is because using single quotes alone. Put it within double quotes and it will work.
              – GiopperOne
              Nov 19 at 5:23










            • Good job! Thank you for cooperation.
              – Kamil Maciorowski
              Nov 19 at 7:00


















            • Simple. I believe the problem here is that the original "cd" command has been aliased. The alias gets the path string as argument and it gets it correctly if you put the first set of quotes. Then it passes it to "cd" but it goes there without quotes and fails. If you put two sets of quotes, the alias gets the string with the first set and then it passes it to "cd" with the second set of quotes and... Magic, it works!
              – GiopperOne
              Nov 18 at 23:32










            • Thanks for your suggestion, I edited my answer and added a reference. I don't have to explain here how to modify a "cd" alias, that would be off-topic. I am answering the question "Any ideas why this is not working?", the answer is because using single quotes alone. Put it within double quotes and it will work.
              – GiopperOne
              Nov 19 at 5:23










            • Good job! Thank you for cooperation.
              – Kamil Maciorowski
              Nov 19 at 7:00
















            Simple. I believe the problem here is that the original "cd" command has been aliased. The alias gets the path string as argument and it gets it correctly if you put the first set of quotes. Then it passes it to "cd" but it goes there without quotes and fails. If you put two sets of quotes, the alias gets the string with the first set and then it passes it to "cd" with the second set of quotes and... Magic, it works!
            – GiopperOne
            Nov 18 at 23:32




            Simple. I believe the problem here is that the original "cd" command has been aliased. The alias gets the path string as argument and it gets it correctly if you put the first set of quotes. Then it passes it to "cd" but it goes there without quotes and fails. If you put two sets of quotes, the alias gets the string with the first set and then it passes it to "cd" with the second set of quotes and... Magic, it works!
            – GiopperOne
            Nov 18 at 23:32












            Thanks for your suggestion, I edited my answer and added a reference. I don't have to explain here how to modify a "cd" alias, that would be off-topic. I am answering the question "Any ideas why this is not working?", the answer is because using single quotes alone. Put it within double quotes and it will work.
            – GiopperOne
            Nov 19 at 5:23




            Thanks for your suggestion, I edited my answer and added a reference. I don't have to explain here how to modify a "cd" alias, that would be off-topic. I am answering the question "Any ideas why this is not working?", the answer is because using single quotes alone. Put it within double quotes and it will work.
            – GiopperOne
            Nov 19 at 5:23












            Good job! Thank you for cooperation.
            – Kamil Maciorowski
            Nov 19 at 7:00




            Good job! Thank you for cooperation.
            – Kamil Maciorowski
            Nov 19 at 7:00










            up vote
            0
            down vote













            There could be more blanks or other non-printable chars that you don't see. Try cd Application*Scrip* or similar.






            share|improve this answer

















            • 1




              This could be it in some other case, but not in this particular one. Note the message is -bash: cd: Application: No such file or directory, not -bash: cd: Application Support: No such file or directory. The command doesn't see the whole argument string in the first place.
              – Kamil Maciorowski
              Nov 18 at 19:38















            up vote
            0
            down vote













            There could be more blanks or other non-printable chars that you don't see. Try cd Application*Scrip* or similar.






            share|improve this answer

















            • 1




              This could be it in some other case, but not in this particular one. Note the message is -bash: cd: Application: No such file or directory, not -bash: cd: Application Support: No such file or directory. The command doesn't see the whole argument string in the first place.
              – Kamil Maciorowski
              Nov 18 at 19:38













            up vote
            0
            down vote










            up vote
            0
            down vote









            There could be more blanks or other non-printable chars that you don't see. Try cd Application*Scrip* or similar.






            share|improve this answer












            There could be more blanks or other non-printable chars that you don't see. Try cd Application*Scrip* or similar.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 18 at 19:32









            Aganju

            8,19931234




            8,19931234








            • 1




              This could be it in some other case, but not in this particular one. Note the message is -bash: cd: Application: No such file or directory, not -bash: cd: Application Support: No such file or directory. The command doesn't see the whole argument string in the first place.
              – Kamil Maciorowski
              Nov 18 at 19:38














            • 1




              This could be it in some other case, but not in this particular one. Note the message is -bash: cd: Application: No such file or directory, not -bash: cd: Application Support: No such file or directory. The command doesn't see the whole argument string in the first place.
              – Kamil Maciorowski
              Nov 18 at 19:38








            1




            1




            This could be it in some other case, but not in this particular one. Note the message is -bash: cd: Application: No such file or directory, not -bash: cd: Application Support: No such file or directory. The command doesn't see the whole argument string in the first place.
            – Kamil Maciorowski
            Nov 18 at 19:38




            This could be it in some other case, but not in this particular one. Note the message is -bash: cd: Application: No such file or directory, not -bash: cd: Application Support: No such file or directory. The command doesn't see the whole argument string in the first place.
            – Kamil Maciorowski
            Nov 18 at 19:38










            up vote
            0
            down vote













            IF your cd isn't a weird alias, then I'd just use TAB with bash's autocomplete (if it's enabled) to fill a working format for you.



            Typing



            cd ApTAB



            looks like it should autofill to something like



            cd Application S


            (If you do have a weird cd alias, then appending Kamil's answer of typing command cd A... should work with TAB's too)



            and then wait for you to type more of the wanted name (followed by anoter TAB to autocomplete the rest). Or just typing TAB once or twice more will display your available options.



            (I'd also not use plain ls, but ls -la or maybe ls -1 instead to see only one entry per line, your ls output isn't clear)






            share|improve this answer





















            • This may be a good advice in a general case (i.e. for future users with similar problems) but I doubt it will immediately help the OP. Note the message is Application: No such file or directory, not Application Support: No such file or directory. If the directory name in the command line simply didn't match the actual name, cd would still comply about the whole argument being wrong. I don't downvote answers that may apply to very similar problems, still I'm noting they don't entirely fit the OP's issue and they cannot explain the root of it.
              – Kamil Maciorowski
              Nov 19 at 9:35










            • I thought so too, but it's a little annoying when the title doesn't fully match the real problem ("My cd is broken"), and tab complete was only mentioned briefly in a comment, so a fuller answer for the "title problem" seemed appropriate.
              – Xen2050
              Nov 19 at 11:59

















            up vote
            0
            down vote













            IF your cd isn't a weird alias, then I'd just use TAB with bash's autocomplete (if it's enabled) to fill a working format for you.



            Typing



            cd ApTAB



            looks like it should autofill to something like



            cd Application S


            (If you do have a weird cd alias, then appending Kamil's answer of typing command cd A... should work with TAB's too)



            and then wait for you to type more of the wanted name (followed by anoter TAB to autocomplete the rest). Or just typing TAB once or twice more will display your available options.



            (I'd also not use plain ls, but ls -la or maybe ls -1 instead to see only one entry per line, your ls output isn't clear)






            share|improve this answer





















            • This may be a good advice in a general case (i.e. for future users with similar problems) but I doubt it will immediately help the OP. Note the message is Application: No such file or directory, not Application Support: No such file or directory. If the directory name in the command line simply didn't match the actual name, cd would still comply about the whole argument being wrong. I don't downvote answers that may apply to very similar problems, still I'm noting they don't entirely fit the OP's issue and they cannot explain the root of it.
              – Kamil Maciorowski
              Nov 19 at 9:35










            • I thought so too, but it's a little annoying when the title doesn't fully match the real problem ("My cd is broken"), and tab complete was only mentioned briefly in a comment, so a fuller answer for the "title problem" seemed appropriate.
              – Xen2050
              Nov 19 at 11:59















            up vote
            0
            down vote










            up vote
            0
            down vote









            IF your cd isn't a weird alias, then I'd just use TAB with bash's autocomplete (if it's enabled) to fill a working format for you.



            Typing



            cd ApTAB



            looks like it should autofill to something like



            cd Application S


            (If you do have a weird cd alias, then appending Kamil's answer of typing command cd A... should work with TAB's too)



            and then wait for you to type more of the wanted name (followed by anoter TAB to autocomplete the rest). Or just typing TAB once or twice more will display your available options.



            (I'd also not use plain ls, but ls -la or maybe ls -1 instead to see only one entry per line, your ls output isn't clear)






            share|improve this answer












            IF your cd isn't a weird alias, then I'd just use TAB with bash's autocomplete (if it's enabled) to fill a working format for you.



            Typing



            cd ApTAB



            looks like it should autofill to something like



            cd Application S


            (If you do have a weird cd alias, then appending Kamil's answer of typing command cd A... should work with TAB's too)



            and then wait for you to type more of the wanted name (followed by anoter TAB to autocomplete the rest). Or just typing TAB once or twice more will display your available options.



            (I'd also not use plain ls, but ls -la or maybe ls -1 instead to see only one entry per line, your ls output isn't clear)







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 19 at 8:17









            Xen2050

            9,69931536




            9,69931536












            • This may be a good advice in a general case (i.e. for future users with similar problems) but I doubt it will immediately help the OP. Note the message is Application: No such file or directory, not Application Support: No such file or directory. If the directory name in the command line simply didn't match the actual name, cd would still comply about the whole argument being wrong. I don't downvote answers that may apply to very similar problems, still I'm noting they don't entirely fit the OP's issue and they cannot explain the root of it.
              – Kamil Maciorowski
              Nov 19 at 9:35










            • I thought so too, but it's a little annoying when the title doesn't fully match the real problem ("My cd is broken"), and tab complete was only mentioned briefly in a comment, so a fuller answer for the "title problem" seemed appropriate.
              – Xen2050
              Nov 19 at 11:59




















            • This may be a good advice in a general case (i.e. for future users with similar problems) but I doubt it will immediately help the OP. Note the message is Application: No such file or directory, not Application Support: No such file or directory. If the directory name in the command line simply didn't match the actual name, cd would still comply about the whole argument being wrong. I don't downvote answers that may apply to very similar problems, still I'm noting they don't entirely fit the OP's issue and they cannot explain the root of it.
              – Kamil Maciorowski
              Nov 19 at 9:35










            • I thought so too, but it's a little annoying when the title doesn't fully match the real problem ("My cd is broken"), and tab complete was only mentioned briefly in a comment, so a fuller answer for the "title problem" seemed appropriate.
              – Xen2050
              Nov 19 at 11:59


















            This may be a good advice in a general case (i.e. for future users with similar problems) but I doubt it will immediately help the OP. Note the message is Application: No such file or directory, not Application Support: No such file or directory. If the directory name in the command line simply didn't match the actual name, cd would still comply about the whole argument being wrong. I don't downvote answers that may apply to very similar problems, still I'm noting they don't entirely fit the OP's issue and they cannot explain the root of it.
            – Kamil Maciorowski
            Nov 19 at 9:35




            This may be a good advice in a general case (i.e. for future users with similar problems) but I doubt it will immediately help the OP. Note the message is Application: No such file or directory, not Application Support: No such file or directory. If the directory name in the command line simply didn't match the actual name, cd would still comply about the whole argument being wrong. I don't downvote answers that may apply to very similar problems, still I'm noting they don't entirely fit the OP's issue and they cannot explain the root of it.
            – Kamil Maciorowski
            Nov 19 at 9:35












            I thought so too, but it's a little annoying when the title doesn't fully match the real problem ("My cd is broken"), and tab complete was only mentioned briefly in a comment, so a fuller answer for the "title problem" seemed appropriate.
            – Xen2050
            Nov 19 at 11:59






            I thought so too, but it's a little annoying when the title doesn't fully match the real problem ("My cd is broken"), and tab complete was only mentioned briefly in a comment, so a fuller answer for the "title problem" seemed appropriate.
            – Xen2050
            Nov 19 at 11:59












            up vote
            -1
            down vote













            It's because you're missing by one word. Try using:



            cd "Application Support GameKit"





            share|improve this answer





















            • I'm repeating myself: This could be it in some other case, but not in this particular one. Note the message is -bash: cd: Application: No such file or directory, not -bash: cd: Application Support: No such file or directory. The command doesn't see the whole argument string in the first place.
              – Kamil Maciorowski
              Nov 18 at 19:39










            • You mis-read the OP; they're 2 different columns
              – Tetsujin
              Nov 18 at 19:39















            up vote
            -1
            down vote













            It's because you're missing by one word. Try using:



            cd "Application Support GameKit"





            share|improve this answer





















            • I'm repeating myself: This could be it in some other case, but not in this particular one. Note the message is -bash: cd: Application: No such file or directory, not -bash: cd: Application Support: No such file or directory. The command doesn't see the whole argument string in the first place.
              – Kamil Maciorowski
              Nov 18 at 19:39










            • You mis-read the OP; they're 2 different columns
              – Tetsujin
              Nov 18 at 19:39













            up vote
            -1
            down vote










            up vote
            -1
            down vote









            It's because you're missing by one word. Try using:



            cd "Application Support GameKit"





            share|improve this answer












            It's because you're missing by one word. Try using:



            cd "Application Support GameKit"






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 18 at 19:38









            Biku Balami

            347113




            347113












            • I'm repeating myself: This could be it in some other case, but not in this particular one. Note the message is -bash: cd: Application: No such file or directory, not -bash: cd: Application Support: No such file or directory. The command doesn't see the whole argument string in the first place.
              – Kamil Maciorowski
              Nov 18 at 19:39










            • You mis-read the OP; they're 2 different columns
              – Tetsujin
              Nov 18 at 19:39


















            • I'm repeating myself: This could be it in some other case, but not in this particular one. Note the message is -bash: cd: Application: No such file or directory, not -bash: cd: Application Support: No such file or directory. The command doesn't see the whole argument string in the first place.
              – Kamil Maciorowski
              Nov 18 at 19:39










            • You mis-read the OP; they're 2 different columns
              – Tetsujin
              Nov 18 at 19:39
















            I'm repeating myself: This could be it in some other case, but not in this particular one. Note the message is -bash: cd: Application: No such file or directory, not -bash: cd: Application Support: No such file or directory. The command doesn't see the whole argument string in the first place.
            – Kamil Maciorowski
            Nov 18 at 19:39




            I'm repeating myself: This could be it in some other case, but not in this particular one. Note the message is -bash: cd: Application: No such file or directory, not -bash: cd: Application Support: No such file or directory. The command doesn't see the whole argument string in the first place.
            – Kamil Maciorowski
            Nov 18 at 19:39












            You mis-read the OP; they're 2 different columns
            – Tetsujin
            Nov 18 at 19:39




            You mis-read the OP; they're 2 different columns
            – Tetsujin
            Nov 18 at 19:39


















             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1376500%2fcant-cd-into-directory-with-space-in-its-name-even-with-quotes-or-escaping%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