D or d come on
D or d come on
D or d come on
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
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
Do. none of you use case insensitive autocomplete? “do ” “Downloads”
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?
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)
bash's autocomplete fails (at least with default settings), but e.g. zsh can figure out what you mean
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? 🤔
Zsh.
Omg looks like people think omz is a shell.
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.
You've come from Windows and have brought dangerous expectations.
MacOS has a case insensitive file system. It causes me untold grief
Why would case sensitive path names be considered dangerous?
I don't know about dangerous, but case-insensitive Unicode comparison is annoying, expensive and probably prone to footguns compared to a simple byte-for-byte equality check.
Obviously, it can be done, but I guess Linux devs don't consider it worthwhile.
(And yes, all modern filesystems support Unicode. Linux stores them as arbitrary bytes, Apple's HFS uses... some special bullshit, and Windows uses UTF-16.)
cd snuts
did you mean smuts?
This is a feature, not a bug
Right? I rather not have a computer automatically autocorrect.
Yeah, and I think most shells will correct this case by pressing tab
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.
This is as stupid as it is funny. I love it <3
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!
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.
Awesome, thanks
How does that handle languages that have different rules for capitalization? For example I and i are not the same letter in Turkish.
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.
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 :)
Shit yo. How come I only learn this now? Thanks!
I love how many people brought up the Turkish "I" as if everyone here is on the Unicode steering committee or just got jobs for Turkish facebook.
I, an English speaker, have personally solved the problem by not having a Turkish I in the name of my Downloads directory, or any other directory that I need to cd into on my computer. I'm going to imagine the Turks solve it by painstakingly typing the correct I, or limiting their use of uppercase I's in general.
In fact, researching the actual issue for more than 1 second seemingly shows that Unicode basically created this problem themselves because the two I's are just seperate letters in Turkic languages. https://en.m.wikipedia.org/wiki/Dotted_and_dotless_I_in_computing
If you nerds think this is bad try doing Powershell for any amount of time. It is entirely case-insensitive.
Why the FUCK did they make characters that look the same have different codepointers in UNICODE? They should've done what they did in CJK and make duplicates have the same codepointer.
Unicode needs a redo.
Well letters don't really have a single canonical shape. There are many acceptable ways of rendering each. While two letters might usually look the same, it is very possible that some shape could be acceptable for one but not the other. So, it makes sense to distinguish between them in binary representation. That allows the interpreting software to determine if it cares about the difference or not.
Also, the Unicode code tables do mention which characters look (nearly) identical, so it's definitely possible to make a program interpret something like a Greek question mark the same as a semicolon. I guess it's just that no one has bothered, since it's such a rare edge case.
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.
So you type cd D
tab and it brings you to Documents
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
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.
You could also say that down
should not complete to download
since those are completely different strings and you shouldn't expect one to get you the other.
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
Use Zsh or Fish and tab completion.
Or better yet, use z or zoxide:
"z down" will fuzzy match the "~/Download" folder.
This is the way!
Yeah, if that's the only reason, changing your shell is overkill.
Never used or heard of it before but apparently zoxide is only for cd
command, do you happen to know if there's some fuzzy match for in general?
At the moment what I do is history foo | grep -i "bar"
alias d="cd ~/Downloads"
Doesn't fish basically fix this?
This is not a bug, it doesn't need to be fixed.
It's funny that you're getting down voted for telling the truth. Nothing to be subjective about either. 😅
Would hope so
You can set bash or zsh to case-insensitive tab completion as well.
Seems like poor configuration either default or not
yeah Fish tab completion works, but one thing I've noticed though is that tab completion for wrong case only works if there's no option with the correct case
e.g. if I have Downloads
and Downloads2
then d
with tab completion will become Downloads
, but if I have Downloads
and downloads2
it will tab complete to downloads2
and D
will complete to Downloads
I've been meaning to look through the Fish documentation to see if I can change that and fuzzy search for history but never got around to it
Use zsh and press tab
I can't relate to this issue at all exactly because I use zsh. Also a little bit related but the fuck
This. Except don't use zsh because this is default in every single shell
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.
You know you prefer the D
OP can definitely handle a bigger D
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.
OMZ and TAB gang raise up!
Op does not know about $CDPATH and tab completion keke
I've seen a number of comments imply the possibility of case insensitive tab completion. Is this real and how do I do it?
I have multiple times fumbled with forgetting to capitalize something, only for the terminal to 'dunk' at me
For bash, this is enough:
undefined
# Bash TAB-completition enhancements # Case-insensitive bind "set completion-ignore-case on" # Treat - and _ as equivalent in tab-compl bind "set completion-map-case on" # Expand options on the _first_ TAB press. bind "set show-all-if-ambiguous on"
If you also add e.g.CDPATH=~/Documents
, it will also always autocomplete from your Documents no matter which directory you're on.
There's probably some way to add it in bash, but if you install zsh and use the default options for everything, it just works! I especially love zsh for things "just work": not just tab completion for directories but also having completion for tools like git, docker, kubectl, etc is super easy, and you don't need any weird magic like in Bash if you want to use an alias with the same completion
i renamed my home folders to dl
, docs
, pics
, etc. and use auto-cd (whatever its called) to just type dl
instead of cd dl
You could just use aliases in your bashrc
alias dl=cd ~/Downloads
Might need quotes around the command.
There are two Linux paradigms that I consider stupid. One is the use of centralized software repositories managed by the distro instead of individual developer maintained installers. The other one is file system case sensibility. They already admitted defeat on the first one with the rise of containerised applications. I wonder how much longer they'll keep the charade on the second one.
Sorry, but you're plain wrong on your first issue. Getting all your packages from one source is one of the biggest upsides of Linux.
Pretty hilarious for mac users, of all people, to complain about centralisation. Like, don't you live in a walled garden?
Just make a downloads folder if you absolutely want to go there
Symlink
ln -s Downloads downloads FTW
But then you're still accessing "Downloads" and not "downloads"
You can also disable case sensivity in bash
this seems like a recipe for disaster
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?
Here's how to fix this[+]
Create $HOME/.config/user-dirs.dirs
with
XDG_DOWNLOAD_DIR="$HOME/downloads"
You may need to logout/in for things to reread this file.
The full list of keys is:
: Since this is Linux, this is a fix for many but not all cases.
XDG User dirs are cool, i agree. But that's not really the problem here
Zoxide and cd down
. ;)
cd dow *tab
Fish baby. Fish.
Don't even have to cd when using completion with fish/zsh. Just type
undefined
down[tab]
Because you need to cd "path to directory" not cd "name" lol
Or use a nicer alternative like zoxide! :)
Or Windows ;)
"tab"