VMware vSphere

 View Only
  • 1.  Cannot cd to folder with spaces in name

    Posted Feb 15, 2013 01:52 AM

    ESXi 5.1

    Using Putty  I am trying to change directories from datastore1 to a folder named Windows 2008 R2 x64.  This was a VM migrated over to ESXi 5.1 using standalone converter.  When I try to cd Windows 2008 R2 x64 from the datastore1 prompt I get an error:

    -sh: cd: can't cd to Windows

    BTW, mv Windows 2008 R2 x64 anyname produces an error:

    mv: can't rename "anyname" no such file or directory

    Any thoughts on how to change the folder name so I can get rid of the spaces?

    Thanks,

    mux



  • 2.  RE: Cannot cd to folder with spaces in name
    Best Answer

    Posted Feb 15, 2013 03:56 AM

    Put the foldername in quotes

    so

    #cd "Windows 2008 etc"

    That should work



  • 3.  RE: Cannot cd to folder with spaces in name

    Posted Feb 15, 2013 06:33 AM

    The quotes worked.  Thank you very much!

    mux



  • 4.  RE: Cannot cd to folder with spaces in name

    Posted Feb 18, 2023 05:27 AM

    Thank you, I was dealing with this and started freaking out... 



  • 5.  RE: Cannot cd to folder with spaces in name

    Posted Feb 15, 2013 03:58 AM

    Another way to do it is use the keyboard "Tab" key

    So do a #cd W and hit the TAB so it will auto complete

    If there are more than one folder with W you might have to type in a few more letters



  • 6.  RE: Cannot cd to folder with spaces in name

    Posted Feb 15, 2013 04:08 AM

    As a_nut_in suggested put the folder name in quotes and then do CD

    Any thoughts on how to change the folder name so I can get rid of the spaces?

    Check Renaming a virtual machine and its files in VMware ESXi/ESX