Results 1 to 4 of 4

Thread: Cannot cd to a folder with $ in the name.

  1. #1
    Join Date
    Dec 2010
    Beans
    8
    Distro
    Ubuntu 10.04 Lucid Lynx

    Cannot cd to a folder with $ in the name.

    I am trying to use the terminal to move to a directory called $bin
    I can open the folder with nautilus but when I try it from the command line,
    cd $bin
    cd /$bin/

    both move me back to my main directory. I am in the parent directory when I issue either of these commands.

    How can I navigate inside and does $ have a special meaning to bash (I suspect it does)??

  2. #2

    Re: Cannot cd to a folder with $ in the name.

    Probably a poor idea to have $ in a dir. name.
    if you must cd to it then use '' around either the path and dir. name or just dir. name
    '$bin'

  3. #3
    Join Date
    Aug 2007
    Location
    Manchester, UK
    Beans
    10,285
    Distro
    Ubuntu

    Re: Cannot cd to a folder with $ in the name.

    mc4man is probably right about having $ in your directory names.

    An alternative option to encasing your directory in quotes would be to escape it, so something like
    Code:
    cd /\$bin/

  4. #4
    Join Date
    Dec 2010
    Beans
    8
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Cannot cd to a folder with $ in the name.

    Its a directory from some old Fortran code so perhaps the original authors had a reason.

    Anyway, single quotes seem to work. Thanks!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •