Tilde command not working

Discussion in 'OS X Mavericks (10.9)' started by learningxl2010, Jul 28, 2014.

  1. learningxl2010 macrumors newbie

    Jul 28, 2014
    I am new to mac and was having snow leopard installed in my macbook. In terminal window I have been using command cd ~ to return to my home folder and it used to work perfectly fine.

    I recently upgraded myself to os x maverick. Now when I use cd ~ command in terminal I get reponse as follows
    -bash: cd: ˜: No such file or directory

    I am learning PHP on apache server. I have started apache server and to change my root directory I have created Myusername.conf file in etc/apache2/user folder, used chmod 644 command & restarted folder. Now when I type localhost/˜Myusername/ address in my browser I get page not found message. I don't understand why ˜(tilde) is not working on my mac.

    Request your Help. Thanking in anticipation

    PS. I tried all the above command in another mac (with 10.6 OSx). The command Cd ~is working there and all my apache procedure mentioned above also works perfectly well

    Attached Files:

  2. mfram macrumors 65816

    Jan 23, 2010
    San Diego, CA USA
    If you use the 'cd' command without an argument, it will send you to your home directory. There are several possibilities.

    First, we can double-check your tilde...

    echo ~; cd; pwd
    You should get two strings which are the same. That's your home directory. If you get any weird messages then it implies there's some permission problem. You mentioned 'chmod 644'. If you change a directory permission to 644 you won't be able to list the contents of the directory anymore. Likely not what you intended. A directory should likely be set to 755. Files to 644.

    BTW, the way ~ works in the shell is independent of how Apache implements ~. They are separate concepts which usually, but not always, point to the same place.

Share This Page