D or d come on

3 years ago by Gollum to c/programmer_humor

aleq 124 points 3 years ago

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.

path: 0 3990862, hotness: undefined, score: 124, children: 14
drolex 93 points 3 years ago

Yes, but this is the default on many distros, so for once the end user is not to blame

path: 0 3990862 3991786, hotness: undefined, score: 93, children: 9
MooseBoys 47 points 3 years ago

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.

path: 0 3990862 3991786 3992133, hotness: undefined, score: 47, children: 8
Synthead 37 points 3 years ago

Keep filling those bugs and stop complaining on random forums, kids

path: 0 3990862 3991786 3992133 3992243, hotness: undefined, score: 37, children: 1
FiskFisk33 5 points 3 years ago

Porque no los dos?

path: 0 3990862 3991786 3992133 3992243 5284546, hotness: undefined, score: 5, children: 0
schnurrito 28 points 3 years ago

Something something symlink Downloads to downloads

path: 0 3990862 3991786 3992133 3992771, hotness: undefined, score: 28, children: 1
MooseBoys 3 points 3 years ago

Yeah but the main issue is that I don’t want there to be a Downloads directory in my home.

path: 0 3990862 3991786 3992133 3992771 4000926, hotness: undefined, score: 3, children: 0
Number358 11 points 3 years ago
path: 0 3990862 3991786 3992133 3998491, hotness: undefined, score: 11, children: 1
paperplane 4 points 3 years ago

This is all fun and games until you try moving a backup to a file system that's case-insensitive

path: 0 3990862 3991786 3992133 3998491 4003493, hotness: undefined, score: 4, children: 0
zlatko 3 points 3 years ago

Why not just cd $XDG_DOWNLOAD_DIR in the first place?

path: 0 3990862 3991786 3992133 4110603, hotness: undefined, score: 3, children: 1
joyjoy 3 points 3 years ago

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.

path: 0 3990862 3991786 3992133 4110603 4958887, hotness: undefined, score: 3, children: 0
Honytawk 7 points 3 years ago

Lower case directories?

Eww

ILikeMineInAWayICanReadThemProperly, instead of ilikemineinawayicanreadthemproperly

path: 0 3990862 3999483, hotness: undefined, score: 7, children: 2
aleq 13 points 3 years ago

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

path: 0 3990862 3999483 4001310, hotness: undefined, score: 13, children: 1
jasory 2 points 3 years ago

CamelCase directories and snake_case files.

path: 0 3990862 3999483 4001310 4174347, hotness: undefined, score: 2, children: 0
eek2121 3 points 3 years ago

Do. none of you use case insensitive autocomplete? “do ” “Downloads”

path: 0 3990862 4214692, hotness: undefined, score: 3, children: 0
Sh1nyM3t4l4ss 91 points 3 years ago

Use a shell with decent auto-completion. I have not been irritated by this in years.

path: 0 3991287, hotness: undefined, score: 91, children: 19
nogooduser 27 points 3 years ago

Won’t autocomplete fail if you do “cd d” and then try the autocomplete?

Or is that what you mean by “decent” auto-completion?

path: 0 3991287 3992403, hotness: undefined, score: 27, children: 6
bdonvr 29 points 3 years ago

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)

path: 0 3991287 3992403 3992520, hotness: undefined, score: 29, children: 0
rasensprenger 25 points 3 years ago

bash's autocomplete fails (at least with default settings), but e.g. zsh can figure out what you mean

path: 0 3991287 3992403 3992915, hotness: undefined, score: 25, children: 0
newIdentity 9 points 3 years ago

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.

path: 0 3991287 3992403 3994148, hotness: undefined, score: 9, children: 3
pgp 5 points 3 years ago

The choice of the letter d was brilliant, that's for sure. Now I'm imagining a folder with a large D.

path: 0 3991287 3992403 3994148 3995003, hotness: undefined, score: 5, children: 2
newIdentity 3 points 3 years ago

I don't get what you mean. It doesn't matter if you write a uppercase or lowercase d

path: 0 3991287 3992403 3994148 3995003 3996810, hotness: undefined, score: 3, children: 1
Zaphod 11 points 3 years ago

Oh my zsh?

path: 0 3991287 3995544, hotness: undefined, score: 11, children: 1
wviana 3 points 3 years ago

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.

path: 0 3991287 3995544 4010747, hotness: undefined, score: 3, children: 0
lightnsfw 6 points 3 years ago

I just don't use caps when naming directories

path: 0 3991287 3996220, hotness: undefined, score: 6, children: 0
Skimmer 2 points 3 years ago

What shell would you recommend? 🤔

path: 0 3991287 3992775, hotness: undefined, score: 2, children: 8
Sh1nyM3t4l4ss 16 points 3 years ago

I use fish which is quite nice OOTB, although if you want a posix compliant shell, zsh with some plugins is also great.

path: 0 3991287 3992775 3992820, hotness: undefined, score: 16, children: 1
ayaya 4 points 3 years ago

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.

path: 0 3991287 3992775 3992820 3994128, hotness: undefined, score: 4, children: 0
stevehobbes 7 points 3 years ago path: 0 3991287 3992775 3994346, hotness: undefined, score: 7, children: 3
yum13241 -9 points 3 years ago

Is fucking irrelevant. Just use your package manager.

path: 0 3991287 3992775 3994346 3996435, hotness: undefined, score: -9, children: 2
stevehobbes 9 points 3 years ago

Get some anger management help.

path: 0 3991287 3992775 3994346 3996435 3998976, hotness: undefined, score: 9, children: 1
wviana 4 points 3 years ago

Zsh.

Omg looks like people think omz is a shell.

path: 0 3991287 3992775 4010780, hotness: undefined, score: 4, children: 0
Swedneck 3 points 3 years ago

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.

path: 0 3991287 3992775 3996362, hotness: undefined, score: 3, children: 0
MonkderZweite 83 points 3 years ago

You've come from Windows and have brought dangerous expectations.

path: 0 3994952, hotness: undefined, score: 83, children: 20
naught 20 points 3 years ago

MacOS has a case insensitive file system. It causes me untold grief

path: 0 3994952 3998516, hotness: undefined, score: 20, children: 13
sysadmin420 29 points 3 years ago

Is a 40 year old it guy who love linux, wat

Macos is case insensitive?!

path: 0 3994952 3998516 3998655, hotness: undefined, score: 29, children: 12
sudo 15 points 3 years ago

OSX offers both case sensitive and case insensitive filesystems

path: 0 3994952 3998516 3998655 3998853, hotness: undefined, score: 15, children: 11
naught 10 points 3 years ago

Defaults to insensitive and if you want to change it you have to reformat 🥲

path: 0 3994952 3998516 3998655 3998853 4003423, hotness: undefined, score: 10, children: 9
sysadmin420 3 points 3 years ago

Wow, I figured it'd be case sensitive, crazy, gotta make it more windows like I guess.

path: 0 3994952 3998516 3998655 3998853 4001571, hotness: undefined, score: 3, children: 0
Honytawk 11 points 3 years ago

Why would case sensitive path names be considered dangerous?

path: 0 3994952 3999358, hotness: undefined, score: 11, children: 5
colonial 12 points 3 years ago

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.)

path: 0 3994952 3999358 4005903, hotness: undefined, score: 12, children: 3
lnee 1 point 3 years ago

so if linux stores file names as arbitrary bytes them could I modify a ext4 fs to include a / in a file name

path: 0 3994952 3999358 4005903 4109190, hotness: undefined, score: 1, children: 1
kattfisk 1 point 3 years ago

If you did it would likely break something as it's one of only two characters not allowed in a file name (the other being null).

You can do a lot of funky stuff within the rules though, think about control characters, non-printing characters, newlines, homographs, emojis etc. and go forth and make your file system chaos!

path: 0 3994952 3999358 4005903 4109190 4118691, hotness: undefined, score: 1, children: 0
MenacingPerson 1 point 3 years ago

Meanwhile fishshell:

path: 0 3994952 3999358 4005903 4023104, hotness: undefined, score: 1, children: 0
MonkderZweite 1 point 3 years ago
path: 0 3994952 3999358 4003211, hotness: undefined, score: 1, children: 0
Asswaterpirate 74 points 3 years ago

cd snuts

path: 0 3996874, hotness: undefined, score: 74, children: 1
zlatko 2 points 3 years ago

did you mean smuts?

path: 0 3996874 4110560, hotness: undefined, score: 2, children: 0
HatFunction 59 points 3 years ago

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.

Wikipedia

path: 0 4005940, hotness: undefined, score: 59, children: 2
FreshLight 10 points 3 years ago

This is as stupid as it is funny. I love it <3

path: 0 4005940 4006421, hotness: undefined, score: 10, children: 0
FlyingSquid 5 points 3 years ago

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!

path: 0 4005940 4070270, hotness: undefined, score: 5, children: 0
SnowdenHeroOfOurTime 59 points 3 years ago

This is a feature, not a bug

path: 0 4003410, hotness: undefined, score: 59, children: 8
Potatos_are_not_friends 31 points 3 years ago

Right? I rather not have a computer automatically autocorrect.

path: 0 4003410 4005375, hotness: undefined, score: 31, children: 7
shotgun_crab 6 points 3 years ago

Yeah, and I think most shells will correct this case by pressing tab

path: 0 4003410 4005375 4010871, hotness: undefined, score: 6, children: 0
AffineConnection 3 points 3 years ago

Also, I constantly name files in the same directory the same thing except for case. In my ~/tmp directory I have unrelated foo.c (C source) and foo.C (C++ source).

path: 0 4003410 4005375 4008376, hotness: undefined, score: 3, children: 5
winky88 4 points 3 years ago

Chaotic evil

path: 0 4003410 4005375 4008376 4011350, hotness: undefined, score: 4, children: 0
Zagorath 2 points 3 years ago

Why not .cpp for C++? I don’t use C++, but I thought that was the standard.

path: 0 4003410 4005375 4008376 4049495, hotness: undefined, score: 2, children: 3
AffineConnection 8 points 3 years ago

.C came first. I don't usually use it though; I usually use .cc or .cxx, but if I'm making some tiny test source, I often use .C. I'm strongly opposed to the .cpp extension because calling C++ "CPP" leads to confusion with the preexisting (before C++) use of the initialism to refer to the C preprocessor. There's a reason why CPPFLAGS refers to preprocessor flags and CXXFLAGS refers to C++ flags.

path: 0 4003410 4005375 4008376 4049495 4049586, hotness: undefined, score: 8, children: 2
MerfMerf 51 points 3 years ago

echo 'set completion-ignore-case On' >> ~/.inputrc

path: 0 3992644, hotness: undefined, score: 51, children: 7
PupBiru 15 points 3 years ago

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?

path: 0 3992644 3993711, hotness: undefined, score: 15, children: 1
MerfMerf 1 point 3 years ago

Or up-arrow a bazillion time because you probably have it SOMEWHERE in the buffer, surely.

path: 0 3992644 3993711 4077520, hotness: undefined, score: 1, children: 0
tostiman 2 points 3 years ago

Awesome, thanks

path: 0 3992644 3996045, hotness: undefined, score: 2, children: 0
jmcs 1 point 3 years ago

How does that handle languages that have different rules for capitalization? For example I and i are not the same letter in Turkish.

path: 0 3992644 3995219, hotness: undefined, score: 1, children: 2
MerfMerf 1 point 3 years ago

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.

path: 0 3992644 3995219 4077722, hotness: undefined, score: 1, children: 0
kattfisk 1 point 3 years ago

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 :)

path: 0 3992644 3995219 4118833, hotness: undefined, score: 1, children: 0
UFODivebomb 1 point 3 years ago

Shit yo. How come I only learn this now? Thanks!

path: 0 3992644 4009811, hotness: undefined, score: 1, children: 0
CodexArcanum 36 points 3 years ago

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/...

If you nerds think this is bad try doing Powershell for any amount of time. It is entirely case-insensitive.

path: 0 3996033, hotness: undefined, score: 36, children: 12
yum13241 8 points 3 years ago

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.

path: 0 3996033 3996389, hotness: undefined, score: 8, children: 11
Tranus 33 points 3 years ago

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.

path: 0 3996033 3996389 3996791, hotness: undefined, score: 33, children: 10
yum13241 -5 points 3 years ago

Why are the Latin "a" and the Cryilic "a" THE FUCKING SAME?

path: 0 3996033 3996389 3996791 3999307, hotness: undefined, score: -5, children: 9
mrpants 21 points 3 years ago

In cases where something looks stupid but your knowledge on it is almost zero it's entirely possible that it's not.

The people that maintain Unicode have put a lot of thought and effort into this. Might be helpful to research why rather than assuming you have a better way despite little knowledge of the subject.

path: 0 3996033 3996389 3996791 3999307 3999530, hotness: undefined, score: 21, children: 8
pchem 28 points 3 years ago path: 0 4101009, hotness: undefined, score: 28, children: 0
starman 27 points 3 years ago

So you type cd D tab and it brings you to Documents

path: 0 3999923, hotness: undefined, score: 27, children: 0
ayushnix 25 points 3 years ago

using capital letters in file/directory names on Linux :|

path: 0 3990842, hotness: undefined, score: 25, children: 3
jonne 37 points 3 years ago

It's a default on some distros, unfortunately, and changing it without updating the necessary env vars will break a bunch of stuff.

path: 0 3990842 3990990, hotness: undefined, score: 37, children: 2
BeanCounter 3 points 3 years ago
path: 0 3990842 3990990 3991995, hotness: undefined, score: 3, children: 0
ayushnix 2 points 3 years ago

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.

path: 0 3990842 3990990 4008603, hotness: undefined, score: 2, children: 0
catlover 25 points 3 years ago

alias d="cd ~/Downloads"

path: 0 4007970, hotness: undefined, score: 25, children: 0
newIdentity 25 points 3 years ago

Use Zsh or Fish and tab completion.

path: 0 3994101, hotness: undefined, score: 25, children: 4
janAkali 8 points 3 years ago

Or better yet, use z or zoxide:
"z down" will fuzzy match the "~/Download" folder.

path: 0 3994101 3995989, hotness: undefined, score: 8, children: 3
words_number 4 points 3 years ago

This is the way!

path: 0 3994101 3995989 3997005, hotness: undefined, score: 4, children: 0
seitanic 2 points 3 years ago

Yeah, if that's the only reason, changing your shell is overkill.

path: 0 3994101 3995989 3998178, hotness: undefined, score: 2, children: 0
Astaroth 1 point 3 years ago

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"

path: 0 3994101 3995989 3998626, hotness: undefined, score: 1, children: 0
Feyter 22 points 3 years ago

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".

path: 0 3992550, hotness: undefined, score: 22, children: 15
Swedneck 20 points 3 years ago

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.

path: 0 3992550 3996190, hotness: undefined, score: 20, children: 1
4am 0 points 3 years ago

Doesn't tab completion solve this if there are no alternatives with matching case? sounds like a PBKAC

path: 0 3992550 3996190 3998480, hotness: undefined, score: 0, children: 0
lemmonade 8 points 3 years ago

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.

path: 0 3992550 3995404, hotness: undefined, score: 8, children: 6
Feyter 3 points 3 years ago

Sorry, down is a substring of download I don't get your point either?

path: 0 3992550 3995404 3996151, hotness: undefined, score: 3, children: 5
Honytawk 2 points 3 years ago

Substring is not string.

If they were interchangeable, then "D" & "d" should be too.

path: 0 3992550 3995404 3996151 3999439, hotness: undefined, score: 2, children: 4
Feyter 1 point 3 years ago

down matches down* because * also includes empty string. Also download matches down*

D matches D* but d is not matching D* because D is a different character than d.

path: 0 3992550 3995404 3996151 3999439 4008153, hotness: undefined, score: 1, children: 3
schnurrito 8 points 3 years ago

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.

path: 0 3992550 3992795, hotness: undefined, score: 8, children: 3
user224 11 points 3 years ago

Now take Android. Files are case-sensitive yet you can't create 2 files with same name if they only vary in case.

path: 0 3992550 3992795 3993924, hotness: undefined, score: 11, children: 2
oleorun 1 point 3 years ago

TIL, thanks. I wonder why they chose to do it this way.

path: 0 3992550 3992795 3993924 3994649, hotness: undefined, score: 1, children: 1
AnUnusualRelic 1 point 3 years ago

They cater to windows users that are used to the quirks of their broken system.

path: 0 3992550 3992795 3993924 3994649 4009029, hotness: undefined, score: 1, children: 0
1984 -2 points 3 years ago

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.

path: 0 3992550 3992675, hotness: undefined, score: -2, children: 1
PupBiru 4 points 3 years ago

“magically know what they want” aka occasionally set you and your files on fire

i prefer not fire

path: 0 3992550 3992675 3993727, hotness: undefined, score: 4, children: 0
muntedcrocodile 22 points 3 years ago

Doesn't fish basically fix this?

path: 0 3994540, hotness: undefined, score: 22, children: 7
pgp 58 points 3 years ago

This is not a bug, it doesn't need to be fixed.

path: 0 3994540 3994830, hotness: undefined, score: 58, children: 2
avonarret1 6 points 3 years ago

It's funny that you're getting down voted for telling the truth. Nothing to be subjective about either. 😅

path: 0 3994540 3994830 3997282, hotness: undefined, score: 6, children: 0
muntedcrocodile 2 points 3 years ago

Would hope so

path: 0 3994540 3994830 3997299, hotness: undefined, score: 2, children: 0
xoggy 15 points 3 years ago

You can set bash or zsh to case-insensitive tab completion as well.

path: 0 3994540 3996567, hotness: undefined, score: 15, children: 1
muntedcrocodile -1 points 3 years ago

Seems like poor configuration either default or not

path: 0 3994540 3996567 3996823, hotness: undefined, score: -1, children: 0
Astaroth 2 points 3 years ago

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

path: 0 3994540 3998341, hotness: undefined, score: 2, children: 0
d_k_bo 1 point 3 years ago path: 0 3994540 3997605, hotness: undefined, score: 1, children: 0
onlinepersona 20 points 3 years ago

path: 0 4002048, hotness: undefined, score: 20, children: 0
willya 19 points 3 years ago

You know you prefer the D

path: 0 3994227, hotness: undefined, score: 19, children: 1
Moc 13 points 3 years ago
path: 0 3994227 3994573, hotness: undefined, score: 13, children: 0
krey 19 points 3 years ago
path: 0 3993412, hotness: undefined, score: 19, children: 2
Morphit 5 points 3 years ago

There's no place like ~.

path: 0 3993412 3998561, hotness: undefined, score: 5, children: 1
AffineConnection 1 point 3 years ago
path: 0 3993412 3998561 4009077, hotness: undefined, score: 1, children: 0
Damage 17 points 3 years ago

Use zsh and press tab

path: 0 3991202, hotness: undefined, score: 17, children: 14
BeanCounter 7 points 3 years ago
path: 0 3991202 3992003, hotness: undefined, score: 7, children: 3
killeronthecorner 3 points 3 years ago

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.

path: 0 3991202 3992003 3992456, hotness: undefined, score: 3, children: 2
toynbee 2 points 3 years ago

You can escape the wildcards as an alternative.

path: 0 3991202 3992003 3992456 3992488, hotness: undefined, score: 2, children: 1
killeronthecorner 3 points 3 years ago

Nice, I didn't know that. I habitually forget the closing quote so this might save me some ire

path: 0 3991202 3992003 3992456 3992488 3992564, hotness: undefined, score: 3, children: 0
mojo 1 point 3 years ago

This. Except don't use zsh because this is default in every single shell

path: 0 3991202 3992251, hotness: undefined, score: 1, children: 6
chris 16 points 3 years ago

Nope. Bash (at least by default on Ubuntu) doesn't have case insensitive tab completion.

path: 0 3991202 3992251 3992352, hotness: undefined, score: 16, children: 2
PupBiru 2 points 3 years ago

afaik there’s options you can turn on that enable it

search .inputrc and set completion-ignore-case On

path: 0 3991202 3992251 3992352 3993771, hotness: undefined, score: 2, children: 1
newIdentity 4 points 3 years ago

Still not a default. Also it's not the same thing.

path: 0 3991202 3992251 3992352 3993771 3994176, hotness: undefined, score: 4, children: 0
Damage 4 points 3 years ago

Bash never does this by default

path: 0 3991202 3992251 3993792, hotness: undefined, score: 4, children: 2
mojo 1 point 3 years ago

Bash has never not had tab completion out of the box for me

path: 0 3991202 3992251 3993792 3997708, hotness: undefined, score: 1, children: 1
Damage 2 points 3 years ago

Tab completion is default, but completing an uppercase word by typing a lowercase letter is not

path: 0 3991202 3992251 3993792 3997708 4151779, hotness: undefined, score: 2, children: 0
aleq 0 points 3 years ago

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.

path: 0 3991202 3992449, hotness: undefined, score: 0, children: 2
1984 5 points 3 years ago

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.

path: 0 3991202 3992449 3992777, hotness: undefined, score: 5, children: 1
aleq 2 points 3 years ago

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.

path: 0 3991202 3992449 3992777 3994047, hotness: undefined, score: 2, children: 0
WindowsEnjoyer 11 points 3 years ago

OMZ and TAB gang raise up!

path: 0 4001427, hotness: undefined, score: 11, children: 0
genfood 11 points 3 years ago

I seems that I have triggered something, but keep that going, it’s quality content generation. 😬

path: 0 3991518, hotness: undefined, score: 11, children: 5
drolex 16 points 3 years ago

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.

path: 0 3991518 3992017, hotness: undefined, score: 16, children: 4
GCostanzaStepOnMe 11 points 3 years ago

Anything that slightly improves UX is bloat.

path: 0 3991518 3992017 3992293, hotness: undefined, score: 11, children: 3
drolex 2 points 3 years ago

True! I've got rid of my monitor a long time ago, who needs one? gshshhshshshhshbsbbs

path: 0 3991518 3992017 3992293 3994408, hotness: undefined, score: 2, children: 2
gnutrino 4 points 3 years ago

I got rid of my whole computer a long time ago, now I just use rocks. Much less bloat.

path: 0 3991518 3992017 3992293 3994408 3995616, hotness: undefined, score: 4, children: 1
TetrisIQ 10 points 3 years ago

You can also disable case sensivity in bash

path: 0 3992043, hotness: undefined, score: 10, children: 8
MooseBoys 23 points 3 years ago

this seems like a recipe for disaster

path: 0 3992043 3992099, hotness: undefined, score: 23, children: 7
rtxn 8 points 3 years ago

Since Linux 5.2, you can disable case sensitivity on the filesystem level on ext4 (called case folding).

path: 0 3992043 3992099 3992258, hotness: undefined, score: 8, children: 5
MooseBoys 20 points 3 years ago

I wonder how many things subtly break when you enable that option.

path: 0 3992043 3992099 3992258 3992316, hotness: undefined, score: 20, children: 0
1984 9 points 3 years ago

Is this a competition for worst idea to solve the problem? :)

path: 0 3992043 3992099 3992258 3992661, hotness: undefined, score: 9, children: 0
AnUnusualRelic 6 points 3 years ago

Is there also an option to only have 8.3 filenames? Those long names are so tiresome.

path: 0 3992043 3992099 3992258 3992848, hotness: undefined, score: 6, children: 0
Dizzar 5 points 3 years ago

How to shoot yourself in the foot in one simple step

path: 0 3992043 3992099 3992258 3992598, hotness: undefined, score: 5, children: 0
xeekei 1 point 3 years ago

This is default in SteamOS.

path: 0 3992043 3992099 3992258 3993925, hotness: undefined, score: 1, children: 0
tigerjerusalem 6 points 3 years ago

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?

path: 0 3992043 3992099 3992811, hotness: undefined, score: 6, children: 0
xnasero 10 points 3 years ago

Op does not know about $CDPATH and tab completion keke

path: 0 4076832, hotness: undefined, score: 10, children: 10
PennyJim 5 points 3 years ago

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

path: 0 4076832 4100768, hotness: undefined, score: 5, children: 9
zlatko 8 points 3 years ago

For bash, this is enough:

# 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.

path: 0 4076832 4100768 4110447, hotness: undefined, score: 8, children: 4
PennyJim 3 points 3 years ago

Setting CDPATH=:~/Documents/Dev makes navigating to any of my projects so much easier.

Thanks for bringing it to my attention

path: 0 4076832 4100768 4110447 4111791, hotness: undefined, score: 3, children: 0
csm10495 2 points 3 years ago

Thanks kind stranger. Never knew of this.

path: 0 4076832 4100768 4110447 4112346, hotness: undefined, score: 2, children: 1
zlatko 1 point 3 years ago

No problem!

As an aside, I see we're bringing the strangers thing over from Reddit. I hope more of the fun and funny stuff gets over, I miss some of the light shitposting.

path: 0 4076832 4100768 4110447 4112346 4115698, hotness: undefined, score: 1, children: 0
kattfisk 1 point 3 years ago

Well completion-ignore-case is enough to solve this particular problem, the other options are just sugar on top :)

I'm going to add completion-prefix-display-length to these related bonus tips (I have it set to 9). This makes it a lot easier to compare files with long names in your tab completion.

For example if you have a folder with these files:

FoobarSystem-v20.69.11-CrashLog2022-12-22 FoobarSystem-v20.69.11.config FoobarSystem-v20.69.12 FoobarSystem-v20.69.12-CrashLog2023-10-02 FoobarSystem-v20.69.12.config FoobarSystem-v20.69.12.userprofiles

Just type vim TAB to see

 ...1-CrashLog2022-12-22   ...1.config   ...2   ...2-CrashLog2023-10-02   ...2.config   ...2.userprofiles
$vim FoobarSystem-v20.69.1

GNU Readline (which is what Bash uses for input) has a lot of options (e.g. making it behave like vim), and your settings are also used in any other programs that use it for their CLI which is a nice bonus. The config file is ~/.inputrc and you'd enable the above mentioned options like this

$include /etc/inputrc

set completion-ignore-case on
set show-all-if-ambiguous on
set completion-map-case on
set completion-prefix-display-length 9
path: 0 4076832 4100768 4110447 4121578, hotness: undefined, score: 1, children: 0
F04118F 2 points 3 years ago

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

path: 0 4076832 4100768 4108082, hotness: undefined, score: 2, children: 3
bnjmn 4 points 3 years ago

Hmm, it didn't "just work" for me. I had to set it up recently:

zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'

That line needs to go in .zshrc. Maybe it's enabled by default with oh-my-zsh?

path: 0 4076832 4100768 4108082 4109142, hotness: undefined, score: 4, children: 2
F04118F 1 point 3 years ago

I'm sorry, that must be it, I immediately installed oh-my-zsh after switching to zsh

path: 0 4076832 4100768 4108082 4109142 4218098, hotness: undefined, score: 1, children: 1
darcy 9 points 3 years ago

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

path: 0 4008547, hotness: undefined, score: 9, children: 8
Rodeo 10 points 3 years ago

You could just use aliases in your bashrc

alias dl=cd ~/Downloads

Might need quotes around the command.

path: 0 4008547 4023961, hotness: undefined, score: 10, children: 7
darcy 1 point 3 years ago

sure, but what if need a subfolder of dl, like dl/source or whatever. same with documents and pictures

path: 0 4008547 4023961 4043092, hotness: undefined, score: 1, children: 6
Rodeo 2 points 3 years ago

You have to try it but I think it still works. Aliases just replaced the text you typed with text in the alias, so if you append a subfolder to the alias it should also be appended to the command.

It's like using !! when navigating folders. You can do cd ~/Downloads and then !!/source and it resolves to cd ~/Downloads/source

path: 0 4008547 4023961 4043092 4082903, hotness: undefined, score: 2, children: 0
MrScottyTay 1 point 3 years ago

I'm sure that still works with aliases. Then you'll have dl/source and Doenloads/source that are the same location. Using aliases will mean any script or program you may use that might point to them won't just create a new default folder that is then no longer the same location as the renamed one that you'll expect everything in

path: 0 4008547 4023961 4043092 4051648, hotness: undefined, score: 1, children: 4
darcy 1 point 3 years ago

ok but if i open a gui file explorer, i can type dl to go to focus downloads, and do can match downloads or documents (or dotfiles)

path: 0 4008547 4023961 4043092 4051648 4063082, hotness: undefined, score: 1, children: 3
ram 7 points 3 years ago

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.

path: 0 4000966, hotness: undefined, score: 7, children: 6
charlotte 22 points 3 years ago

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.

path: 0 4000966 4001506, hotness: undefined, score: 22, children: 5
onlinepersona 4 points 3 years ago

Pretty hilarious for mac users, of all people, to complain about centralisation. Like, don't you live in a walled garden?

path: 0 4000966 4001506 4001964, hotness: undefined, score: 4, children: 0
EddoWagt 2 points 3 years ago

Indeed, but I'm sure we can agree that it's pretty stupid for every distro to maintain its own repo. That's a lot of duplicate work, which could be spend on more useful things. Luckily flatpak is well on its way to change that

path: 0 4000966 4001506 4002902, hotness: undefined, score: 2, children: 3
charlotte 3 points 3 years ago

Hm... But different distros have different philosophies (not just) about updates. That's part of why people choose a specific distro.

Theres still plenty speaking against flatpak (larger sizes, problems with GTK/qt themes, and it's only meant for GUI applications - you still need a separate system for the kernel and lower-level/cli tools. And frankly, that makes flatpak unusable to me, because the purpose of a centralized package management system is not having duplicate systems).

So in short: y'all are gonna pry pacman from my cold, dead hand.

path: 0 4000966 4001506 4002902 4005021, hotness: undefined, score: 3, children: 2
tslnox 1 point 3 years ago

The same goes for me, but with Portage, brother.

path: 0 4000966 4001506 4002902 4005021 4020282, hotness: undefined, score: 1, children: 0
EddoWagt 0 points 3 years ago

I'm not against distros as a whole, some extra work will be inevitable because people have different preferences, but it feels like a waste having a Firefox package for arch, ubuntu, fedora and Debian while essentially all being identical. Indeed flatpak isn't perfect yet, but it works great for me and it's steadily improving

path: 0 4000966 4001506 4002902 4005021 4046297, hotness: undefined, score: 0, children: 0
Kanda 7 points 3 years ago

Just make a downloads folder if you absolutely want to go there

path: 0 4048907, hotness: undefined, score: 7, children: 6
caseyweederman 10 points 3 years ago

Symlink

path: 0 4048907 4062974, hotness: undefined, score: 10, children: 2
lnee 2 points 3 years ago

mount bind

path: 0 4048907 4062974 4109117, hotness: undefined, score: 2, children: 1
caseyweederman 1 point 3 years ago

...why is it so hard to find a picture of a mountain with a harness on it

path: 0 4048907 4062974 4109117 4110058, hotness: undefined, score: 1, children: 0
zlatko 1 point 3 years ago

ln -s Downloads downloads FTW

path: 0 4048907 4110455, hotness: undefined, score: 1, children: 2
jabberati 1 point 3 years ago
path: 0 4048907 4110455 4115078, hotness: undefined, score: 1, children: 0
Kanda 1 point 3 years ago

But then you're still accessing "Downloads" and not "downloads"

path: 0 4048907 4110455 4118503, hotness: undefined, score: 1, children: 0
steltek 7 points 3 years ago

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:

  • XDG_DESKTOP_DIR
  • XDG_DOWNLOAD_DIR
  • XDG_TEMPLATES_DIR
  • XDG_PUBLICSHARE_DIR
  • XDG_DOCUMENTS_DIR
  • XDG_MUSIC_DIR
  • XDG_PICTURES_DIR
  • XDG_VIDEOS_DIR

+: Since this is Linux, this is a fix for many but not all cases.

path: 0 4000653, hotness: undefined, score: 7, children: 1
lastweakness 4 points 3 years ago

XDG User dirs are cool, i agree. But that's not really the problem here

path: 0 4000653 4000924, hotness: undefined, score: 4, children: 0
boyi 5 points 3 years ago

Don't even have to cd when using completion with fish/zsh. Just type

down[tab]
path: 0 4115843, hotness: undefined, score: 5, children: 0
spez 5 points 3 years ago

Fish baby. Fish.

path: 0 4111862, hotness: undefined, score: 5, children: 0
lfromanini 5 points 3 years ago

Zoxide and cd down. ;)

path: 0 4001860, hotness: undefined, score: 5, children: 0
Uncle_Iroh 4 points 3 years ago

Because you need to cd "path to directory" not cd "name" lol

path: 0 3990810, hotness: undefined, score: 4, children: 3
genfood 1 point 3 years ago

lol

path: 0 3990810 3990828, hotness: undefined, score: 1, children: 2
coffeebiscuit 3 points 3 years ago path: 0 3990810 3990828 3990910, hotness: undefined, score: 3, children: 1
PipedLinkBot 1 point 3 years ago path: 0 3990810 3990828 3990910 3990912, hotness: undefined, score: 1, children: 0
SorteKanin 3 points 3 years ago

Or use a nicer alternative like zoxide! :)

path: 0 3991172, hotness: undefined, score: 3, children: 1
Slartibartfass 0 points 3 years ago

Or Windows ;)

path: 0 3991172 3992267, hotness: undefined, score: 0, children: 0
FiskFisk33 1 point 3 years ago

"tab"

path: 0 5284575, hotness: undefined, score: 1, children: 0
programmer_humor
programmer_humor

@programming.dev

login for more options
33631
2561
7551

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
    • If the mod doesn't find it funny, you're banned. Ha-ha!... For real: do not use the community for "statements". There are other places for such content. Keep it chill and funny.

go to feed...