Can't Change to Directory in Ubuntu
-
@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.
-
@thecreativeone91 said:
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.
That or on shared space what we do is just put a ! in front of the name
!mp3 !ogg !wave
This top sorts and and sets it apart and doesn't really break anything, though you do have to escape when cding to it when not using Windows, but that's easy and auto-tabbed. I mean I get prefixing the file name, but why with a period as well? And also why post fix it with another dot and period?
-
@tonyshowoff said:
@thecreativeone91 said:
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.
That or on shared space what we do is just put a ! in front of the name
!mp3 !ogg !wave
This top sorts and and sets it apart and doesn't really break anything, though you do have to escape when cding to it when not using Windows, but that's easy and auto-tabbed. I mean I get prefixing the file name, but why with a period as well? And also why post fix it with another dot and period?
It's just what I did at the time and I've never changed it. Never had a reason to until now. Still, it works and as long as I know what I have to do to get into it if I have to, I'm fine.
-
@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.
Best practice for life in general - don't use weird, pointless, filesystem-specific "allowances" in file names. There is no benefit but it ads risk. Even for home use, don't create the practice or habit.
I don't even use caps or spaces in file names!
-
@scottalanmiller said:
Best practice for life in general - don't use weird, pointless, filesystem-specific "allowances" in file names. There is no benefit but it ads risk. Even for home use, don't create the practice or habit.
Agreed! Except I like to use caps and spaces in my file names (no puncuation!)... If I need to open it or work on it from the CLI, then I just enclose the file name in quotes...
-
@scottalanmiller said:
I don't even use caps or spaces in file names!
Same. everyone thinks I'm odd for doing folder_name or file_name.ext
-
Story time! I learned this lesson a really hard way. Right after I graduated high school one of the largest companies in town was hiring for a C# developer and a Friend of mine was all ready working there. I thought I had it in the bag, the interview went great, I met with the director of the department. I just had one final piece, go home and spend less than an hour or two writing a program that did XY & Z. So I headed home, and started writing code. However I couldn't get my debugger to connect to my project. I tried all night, this was my first attempt at programming outside of a school environment, So I ended up having to write and debug a small project by double clicking the .exe and putting tons of message boxes in the code to pop up constantly with variable values to step through the entire project. The next day I emailed in an ugly buggy mess, and was turned down for the job.
The reason it was all a mess is my Windows User name had an ‘&’ in it, and it was messing up the directory to the project for Visual Studio and the debugger.
End the end, I ended up getting the same job 7 years later (2014) and the guy that interviewed me still works as a contractor around here. We have talked about it, and had a good laugh. I ended up getting staying at my old job, learned a ton and met all the people on here. It all worked out in the end.
Here is the other lesson to take away from this for the younger group on here. I never blamed my computer, Windows, God, life, or anyone else. It was my fault, I didn’t know it at the time, but I made the user name. I learned from it, I got better with my skills, and eventually another spot opened up around here, and I got it.