- cross-posted to:
- [email protected]
- cross-posted to:
- [email protected]
So you type
cd D
tab and it brings you toDocuments
cd dow *tab
using capital letters in file/directory names on Linux :|
It’s a default on some distros, unfortunately, and changing it without updating the necessary env vars will break a bunch of stuff.
It would be a default on almost every distro that follows XDG specifications to have stuff like Downloads, Pictures, Videos in the
$HOME
folder. One of the first things I do as part of an installation is to modify~/.config/user-dirs.dirs
and set a specific folder, say/data/downloads
or~/downloads
, for every XDG base directory.Doesn’t Ubuntu do this? I use Ubuntu inside WSL and it bugged me so fucking much
Because you need to cd “path to directory” not cd “name” lol
lol
Reasonable and sane behavior of
cd
. Just get into the habit of always using lower case names for files and directories, that’s how our forefathers did it.Yes, but this is the default on many distros, so for once the end user is not to blame
Even worse, many components will ignore the
XDG_DOWNLOAD_DIR
var so even if you manually change it to$HOME/downloads
(lower-case) it will often break things.Why not just
cd $XDG_DOWNLOAD_DIR
in the first place?That’s not an environment variable. It’s defined in
${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs
.Though you can use the
xdg-user-dir DOWNLOAD
command to get it automatically.
Something something symlink Downloads to downloads
Yeah but the main issue is that I don’t want there to be a
Downloads
directory in my home.
Keep filling those bugs and stop complaining on random forums, kids
Porque no los dos?
ln -s ~/Downloads ~/downloads
This is all fun and games until you try moving a backup to a file system that’s case-insensitive
Do. none of you use case insensitive autocomplete? “do ” “Downloads”
Lower case directories?
Eww
ILikeMineInAWayICanReadThemProperly, instead of ilikemineinawayicanreadthemproperly
If a directory has multiple words in it I usually do kebab case: i-like-mine-in-a-way-i-can-read-them-properly. Both easier to read and type than pascal case.
For more complex filenames I use a combination of kebab-case and snake_case, where the underscore separates portions of the file name and kebab-case the parts of those portions. E.g.
movie-title_release-date-or-year_technical-specifications.mp4
CamelCase directories and snake_case files.
Use zsh and press tab
This. Except don’t use zsh because this is default in every single shell
Bash never does this by default
Bash has never not had tab completion out of the box for me
Tab completion is default, but completing an uppercase word by typing a lowercase letter is not
Nope. Bash (at least by default on Ubuntu) doesn’t have case insensitive tab completion.
afaik there’s options you can turn on that enable it
search .inputrc and set completion-ignore-case On
Still not a default. Also it’s not the same thing.
deleted by creator
Just uninstall bash after
deleted by creator
Everyone’s playing checkers while my man’s playing chess
Everyone’s playing checkers while my man’s playing chess
I remember having that when I used OhMyZsh, but after going back to a more bespoke config it doesn’t work anymore. Also tried using zsh as a different user to ignore my own configs, that doesn’t work either.
tldr, it’s not default zsh behavior.
It’s not default in zsh maybe, but it’s default in the oh-my-zsh config most people use.
I ran zsh for a while without that config and manually configured everything and it also works, but takes quite a bit of web searching to find all the knobs to turn.
I don’t think most people use oh-my-zsh. It’s very popular, and a lot of people use it, but I think most is a stretch.
Either way, it’s just a set of plugins and configs so of course you can get it to work on any setup. Just saying that it’s not inherent to zsh, and you can probably get similar behavior in most shells with a similar config.
zsh is so much nicer to work with
The only thing that annoys me is having to wrap wildcard expressions in quotes when using e.g. the find command.
But then it looks more correct, so it’s hard to argue with.
You can escape the wildcards as an alternative.
Nice, I didn’t know that. I habitually forget the closing quote so this might save me some ire
I can’t relate to this issue at all exactly because I use zsh. Also a little bit related but the fuck
You can also disable case sensivity in bash
this seems like a recipe for disaster
Since Linux 5.2, you can disable case sensitivity on the filesystem level on ext4 (called case folding).
This is default in SteamOS.
I wonder how many things subtly break when you enable that option.
How to shoot yourself in the foot in one simple step
Is this a competition for worst idea to solve the problem? :)
Is there also an option to only have 8.3 filenames? Those long names are so tiresome.
Honest question: is case sensitivity that important? Are there files named settings.ini and Settings.ini, for example, in the same folder that do different things?
I seems that I have triggered something, but keep that going, it’s quality content generation. 😬
Everyone on any Linux thread ever: you are a moron, obviously and you’re doing it wrong. Why don’t you install another distro, or better yet: modify and recompile your distro to match your desired experience, the code is open source ffs! What do you need? 4 years of work maybe? Come on.
Anything that slightly improves UX is bloat.
True! I’ve got rid of my monitor a long time ago, who needs one? gshshhshshshhshbsbbs
I got rid of my whole computer a long time ago, now I just use rocks. Much less bloat.
bro that xkdc is gold
Or use a nicer alternative like zoxide! :)
Or Windows ;)
Use a shell with decent auto-completion. I have not been irritated by this in years.
Won’t autocomplete fail if you do “cd d” and then try the autocomplete?
Or is that what you mean by “decent” auto-completion?
bash’s autocomplete fails (at least with default settings), but e.g. zsh can figure out what you mean
Not with a decent autocomplete. It will look for a folder starting with a small d and if it doesn’t exist it looks at a folder with a large D.
The choice of the letter d was brilliant, that’s for sure. Now I’m imagining a folder with a large D.
I don’t get what you mean. It doesn’t matter if you write a uppercase or lowercase d
No, it will probably go to “Documents”, and if you hit tab again it should go to “Downloads”. (Assuming you have the normal default folders)
Oh my zsh?
No. Zsh. It’s pretty easy to have a nice auto compl. No need for omz. After knowing poweline10k I just use it and syntax highlight plugin, manually installed. There is no need to add entire omz.
I just don’t use caps when naming directories
What shell would you recommend? 🤔
Is fucking irrelevant. Just use your package manager.
Get some anger management help.
Maybe stop trying to be a smartass.
I personally like xonsh despite the minor amount of wonkiness it has, it’s so nice to have python available directly in your shell, it takes the “i don’t care about the quality of my code i just want this shit to work with minimal effort”-ness of bash and turns it up to 13.
I use fish which is quite nice OOTB, although if you want a posix compliant shell, zsh with some plugins is also great.
If you need to run a set of commands or a script with fish you can just toss them in a file and run
bash file.sh
. I have been daily driving fish for years and I don’t even have think about it.
Zsh.
Omg looks like people think omz is a shell.
echo ‘set completion-ignore-case On’ >> ~/.inputrc
also idk does zsh do this automatically? don’t think i’ve ever had this problem except on legacy AF servers
i mean… unless you don’t tab complete, but then who doesn’t spam tab 30 times every keystroke?
Or up-arrow a bazillion time because you probably have it SOMEWHERE in the buffer, surely.
Shit yo. How come I only learn this now? Thanks!
How does that handle languages that have different rules for capitalization? For example I and i are not the same letter in Turkish.
I believe that type of stuff is specified in your locale, so it’s possible that it would do the right thing if you’ve set your language to Turkish. Please try it and let us know though :)
Don’t know actually, never used a language like that. But should be easy enough to undo should one test it and end up not liking how it handles it.
Awesome, thanks
I don’t get it… “D” is a complete different character than “d” is.
It’s like wondering why “file1” is not opened when I typed in “file2”.
that’s not how language works though, in human language (i know this can be confusing) d and D are the same letter just in different forms.
It’s one thing to have case sensitivity in programs doing data manipulation, that makes sense because you don’t want the program to accidentally use the wrong files without supervision.
But when you have an interactive prompt you know what you’re doing, you can see if you entered the wrong directory, and you’re generally going to be working in directories that you have yourself organized.
Doesn’t tab completion solve this if there are no alternatives with matching case? sounds like a PBKAC
People want their computers to magically know what they want these days. :)
This specific problem doesn’t exist in oh-my-zsh config though. It will find the directory even if spelling it like this.
“magically know what they want” aka occasionally set you and your files on fire
i prefer not fire
On Windows filenames are case insensitive at least usually, some people are used to that. But that is poor design for so many reasons, Turkish I being one of them.
Now take Android. Files are case-sensitive yet you can’t create 2 files with same name if they only vary in case.
TIL, thanks. I wonder why they chose to do it this way.
They cater to windows users that are used to the quirks of their broken system.
One of the most pointlessly annoying things I’ve had to deal with was trying to move a process made for Linux onto a Windows MINGW/cygwin-type environment where one of the scripts would generate “.filename” AND “.FileName” files. :|
You could also say that
down
should not complete todownload
since those are completely different strings and you shouldn’t expect one to get you the other.Sorry,
down
is a substring ofdownload
I don’t get your point either?Substring is not string.
If they were interchangeable, then “D” & “d” should be too.
down
matchesdown*
because*
also includes empty string. Alsodownload
matchesdown*
D
matchesD*
butd
is not matchingD*
becauseD
is a different character thand
.but why do we have to match specifically against
substr*
? it’s not a law of nature, we could also match against the regex(?i)substr(?-i).*
not saying that one option is necessarily better, but I don’t see a good reason for which any one of these options would be terrible
Because usability. If you have the files
down
down1
down2
downxyz
anddownload
and the user only knows that it was “something with down” it’s best to show the user everything matching “down*” and let the user decide what’s the correct one.Also I’m not sure but wouldn’t your expression show everything if only one character would be entered?
And again I don’t see this solving anything if the entered string actually contains other characters then what’s in the file (
D
!=d
)Yes one could argue that some form of advanced algorithm or even AI could be used to identify such use case like download and Download but this is programming Humor, not linguisic Humor.
would it not be usable to have completion be case insensitive? I seem to be able to use that… if I only remember “something with down”, I could just as easily forget the capitalization of “down”. maybe I have
downloads
andDown
? why not show everything matching case insensitively and let the user decide what’s the correct one?I didn’t really understand what you thought the regex did incorrectly, but I think the regex works fine, at least for most implementations, anyways what I meant is just a case insensitive version of the regular substring completion, which shouldn’t be too difficult to make.
The only thing it solves is the frustration of having to look for a file/directory twice because you didn’t remember it’s capitalization. again, those are different characters just like a
do
anddownloads
are different strings, but it can be easier for users if they can just press tab and let the computer fill the part of the name the don’t remember (or don’t want to type).you don’t need an advanced algorithm or and AI, there are many easy ways to make completion case insensitive (like that regex for example). Issues involving names are inherently somewhat linguistic, but either way interactive shells are meant to be (at least somewhat) usable to humans, and as seen by the post, some people would prefer completion to be case insensitive.
alias d=“cd ~/Downloads”
This is completely unrelated to the meme at hand, but the title just reminded me that for a while, Merriam-Webster mistakenly included the word “Dord” to mean density - because an editor misread the entry for “D or d” as an abbreviation of density.
I am regularly disappointed that the word games I play on my phone don’t accept ‘dord.’ They should, damn it! One of them accepts Jedi, ffs!
This is as stupid as it is funny. I love it <3