How do I cd into a directory with a leading backslash?
Say I'm here:
/home/me/ ls -l: drwxrwxrwx 2 me me 4.0K Apr 10 22:57 \folder/ how do I cd into \folder/ ? cg |
cd "\folder"
|
Afraid not, I get:
-bash: cd: \folder: No such file or directory cd |
tried cd \\folder?
|
Yep, the same error message!
cg |
Are you sure there are no hidden characters or anything in the directory name, just a backslash? \\folder works for me.
|
You could start the name and use the tab key to complete it.
For example: cd \\fold<tab> |
I use zsh as opposed to bash but 'cd \\dir' works fine here. Maybe this, it's worked for me before when typos lead to weird directory names.
Code:
cd -- \\dir |
Quote:
cg |
Quote:
cg :cry: |
Quote:
ls -l | grep me | awk '{print $9)' | xargs cd ? cg |
To check, you can do: 'ls -Q'
This will show any control characters in an octal-encoded form. Let us know what this shows. |
Thanks, but it reports all is well:
Code:
"\240"/ This is driving me nuts! I can neither delete or cd into this directory... cg |
Maybe this helps, when I type cd then hit tab it brings up a list of choices, one of them is:
Code:
/ cg |
Ok using vim (ahhh vim) to view the directory structure it labels the directory as:
Code:
<a0>/ cg |
All times are GMT -5. The time now is 07:51 AM. |