Can't Change to Directory in Ubuntu
-
or try cd "-directory" or cd *directory
-
@lance said:
I think that if your file starts with a hyphen you have to use another hyphen --.MP3.0- to cd into it.
Ok, I'll give that a shot. Thanks!
-
@lance said:
I think that if your file starts with a hyphen you have to use another hyphen --.MP3.0- to cd into it.
Nope, that wasn't it. Paging @scottalanmiller
-
@thanksajdotcom No problem, hopefully it works for you. Those darn hyphens can cause issues sometimes...
-
Ok, got it! Syntax is as follows:
cd -- -.MP3.-
Thanks!
-
-
Have you tried using cd against the entire path? Or the parent path? either
cd ../folder/-.MP3.-
or
cd /parentfoldertree/-.MP3.-
Or you could try it with absolute quotes
cd '-.MP3.-'
-
@coliver said:
Have you tried using cd against the entire path? Or the parent path? either
cd ../folder/-.MP3.-
Or you could try it with absolute quotes
cd '-.MP3.-'
Tried it with the quotes. That didn't work. If I go up a level and then do this, it works as well...
cd Music/-.MP3.-
Thanks for the suggestion!
-
Tab completion may also have made this easier. Not sure though.
-
@thanksajdotcom said:
Ok, got it! Syntax is as follows:
cd -- -.MP3.-
Thanks!
Awesome! I knew it was something like that... It's been awhile since I ran into that.
-
@coliver said:
Tab completion may also have made this easier. Not sure though.
Nope, it didn't. Tried that too.
-
@lance said:
@thanksajdotcom said:
Ok, got it! Syntax is as follows:
cd -- -.MP3.-
Thanks!
Awesome! I knew it was something like that... It's been awhile since I ran into that.
Yeah, the file structure was originally designed to be accessed under Windows and I'd just never navigated to these directories under Linux until today. They still read the files inside fine. Just changing to it was a bit wonky. Lol
-
Also you can use backslashes, and in fact that's the more "proper" way to escape the characters.
cd \-.MP3.\-
...for example. Quotes may work slightly differently, or not at all, depending on what you're doing, so maybe get used to escaping things the other way. You can also make this behaviour happen automagically by hitting tab to autocomplete with some shells and it will auto escape required characters.
-
@tonyshowoff said:
Also you can use backslashes, and in fact that's the more "proper" way to escape the characters.
cd \-.MP3.\-
...for example. Quotes may work slightly differently, or not at all, depending on what you're doing, so maybe get used to escaping things the other way. You can also make this behaviour happen automagically by hitting tab to autocomplete with some shells and it will auto escape required characters.
I tried that. That didn't work either.
-
The two solutions are either...
cd Music/-.MP3.- cd -- -.MP3.-
Thanks,
A.J. -
My fault, I forgot files starting with a hyphen are treated completely differently, but you can do this:
anton@c0:~$ mkdir -- -.MP3.- anton@c0:~$ cd -- -.MP3.- anton@c0:~/-.MP3.-$
Or even
anton@c0:~$ mkdir ./-.MP3.- anton@c0:~$ cd ./-.MP3.- anton@c0:~/-.MP3.-$
So you need not navigate from parent at all, you can do it from the working directory itself. Navigating from parent seems painful, but parents usually are a pain.
-
Why is this directory named something so bizarre, by the way?
-
@tonyshowoff said:
Why is this directory named something so bizarre, by the way?
I didn't have any Linux systems connected to it when I named all these and I don't really have a reason, it's just how I named it at the time. I think these directories were originally part of a larger folder structure so I started the name with a dash to put them at the top and also so all the format folders would be grouped together.
-
See examples:
root@jump-server:<path removed># ls Amazon MP3 iTunes -.MP3.- Playlists Unsorted Output Archive -.OGG.- _SYNCAPP -.WAV.- -.FLAC.- -.M4A.- Picard Plugins Temp -.WMA.-
-
@thanksajdotcom said:
@tonyshowoff said:
Why is this directory named something so bizarre, by the way?
I didn't have any Linux systems connected to it when I named all these and I don't really have a reason, it's just how I named it at the time. I think these directories were originally part of a larger folder structure so I started the name with a dash to put them at the top and also so all the format folders would be grouped together.
On Any OS that doesn't really make any sense. Underscores are normally used instead of spaces. but, a hyphen and period in a folder is a bit of a no-no.