Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a folder, name of my folder is #. How can I change directory (cd) to this folder.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

You simply need to escape the # with a \

For example I created a folder called #test in my home folder

warren@VBox:~$ ls
a.out  bad.c.save  Desktop    Music     share      #test
bad    bad.s       Documents  Pictures  src        Videos
bad.c  crap        Downloads  Public    Templates

As expected cd #test does not work because everything after the # is a comment

warren@VBox:~$ cd #test
warren@VBox:~$ ls
a.out  bad.c.save  Desktop    Music     share      #test
bad    bad.s       Documents  Pictures  src        Videos
bad.c  crap        Downloads  Public    Templates

But cd \#test does

warren@VBox:~$ cd \#test
warren@VBox:~/#test$ ls
hjjhk.txt  #test1
warren@VBox:~/#test$ 
share|improve this answer
    
thanks. working fine –  messi fan Apr 9 '13 at 10:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.