opening a directory with single quote in its name

9,848

Solution 1

Either escape spaces and the quote with \, or wrap the whole directory name in double quotes.

Solution 2

suround the directory name with quotes

$ cd "02. Setting Up 'Shop"

or mask the 'special' characters

$ cd 02.\ Settings\ Up\ \'Shop
Share:
9,848

Related videos on Youtube

coure2011
Author by

coure2011

Updated on September 18, 2022

Comments

  • coure2011
    coure2011 over 1 year

    I have to open a directory from terminal but the directory name contains a single quote, how Can I open it? Here is the name of the directory

    02. Setting Up 'Shop
    
    • HikeMike
      HikeMike about 12 years
      You forgot to tell us what OS you're using.
    • coure2011
      coure2011 about 12 years
      remotely accessing CentOS from Mac terminal
  • coure2011
    coure2011 about 12 years
    -bash: 33m]ommand not found -bash: 31m: command not found
  • daniel kullmann
    daniel kullmann about 12 years
    a dot doesn't have to be escaped.
  • boretom
    boretom about 12 years
    @danielkullmann: Of course you're right, sill me :)