How to cd to a folder with two dots in the path
I don't believe that is an actual directory, I suspect that that is just a file with backslashes. Try deleting that file directly and it should be removed.
This will work: rm '..\lib\plugin\amd.dll'
I am also not sure how smart cd
is on a CentOS system, it might only show autocomplete options for directories only. In which you would have to do rmdir '..\lib\plugin\amd.dll'
(assuming it is empty). You can determine this by running ls -l
in the /var/lib/mysql/mysql/
directory and seeing if that is a file or a directory and then issue the correct command accordingly.
On a Linux system the backslahes are just treated as characters in the file name and not directory separators. Therefore there is no special distinction when using them in the context of directories. Backslashes are typically used as escape characters for special characters.
There are two problems. You don't say what you're typing before autocomplete, which complicates matters, and you're behaving as if that's a file in another directory, which it's not - backslashes aren't path separators in unix, as you've noted, they're just characters in a filename.
As for the second, stop trying to cd
. Shell won't autocomplete that filename to cd
, whatever you do, because it's not a directory. The file is in .
, just rm
it.
As to the first, you can't just type ..
to autocomplete, as that's not an unambiguous match (the directory also contains ..
, as it must). You can't just type ..\
to autocomplete, because backslash is a metacharacter which escapes the one that follows it, and shell doesn't know what that is - it could be anything, or nothing. If, however, you type
rm ..\\
then hit TAB
(assuming this is bash), then the filename should get filled in correctly. I just tried it, and it worked for me (bash 4.3.42(1) under Fedora 22).