Terminal - How to access files written with space in command line?

Discussion in 'Mac Apps and Mac App Store' started by honorfield, Sep 13, 2009.

  1. honorfield macrumors newbie

    Joined:
    Sep 13, 2009
    #1
    Hey there!

    I'm new with the mac. I'd like to hide some of the folders in my Documents folder (Adobe, Microsoft User Data, ...). I found already the solution for it with writing the following lines in command line:

    sudo chflags hidden ~/Documents/(whatever folder you want to hide)

    But what if the folder has got a name with spaces like 'Microsoft User Data'?
    When i type the address i get the following error:

    110:~ appleuser$ sudo chflags hidden ~/Documents/Microsoft User Data
    chflags: /Users/appleuser/Documents/Microsoft: No such file or directory
    chflags: User: No such file or directory
    chflags: Data: No such file or directory
    110:~ appleuser$


    Is there any solution? It would be so good for the peace of my mind to have this documents folder clean:)

    honorfield
     
  2. mysterytramp macrumors 65816

    mysterytramp

    Joined:
    Jul 17, 2008
    Location:
    Maryland
    #2
    put quotes around the folder name.

    If you use AppleScript, it makes easier:

    quoted form of Posix path of (variable pointing to folder)

    mt
     
  3. honorfield thread starter macrumors newbie

    Joined:
    Sep 13, 2009
    #3
    Great

    Thanks so much, putting the folder name in quotes worked!!!

    Can you also tell me a way to make them visible again, just in case i need it in the future (and to close this topic up:)

    Regards
    honorfield
     

Share This Page