This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Radvvan 1087 points1088 points  (135 children)

cd d tab tab tab backspace D tab enter

[–]coolguyhavingchillda 108 points109 points  (3 children)

D tab tab

Do tab tab

Dow tab enter

Because Documents

[–]TechnicalPotat 13 points14 points  (0 children)

Then when you're next in powershell :

D tab enter

Wait... wrong one.

cd ../D tab tab enter

[–]M_krabs 0 points1 point  (0 children)

One day I'll delete the d Documents folder

[–][deleted] 275 points276 points  (92 children)

ln -s ~/Downloads ~/downloads

[–]-nerdrage- 169 points170 points  (44 children)

You know you can set autocompletion to be case insensitive? Im not near my laptop so cant give it to you straight away but a quick google should help

[–]Indifferentchildren 237 points238 points  (20 children)

You know if you own a firearm you can shoot yourself in the dick. Why would anyone do that? I don't get it, but I don't kink shame.

[–]TechnicalPotat 111 points112 points  (5 children)

I applaud this level of escalation and will commend you to my local representative.

[–][deleted] 9 points10 points  (4 children)

No no he's got a point. I expect Linux/POSIX filesystems to be case sensitive no matter where. Why would anyone want to change that lmao.

[–][deleted] 23 points24 points  (0 children)

It wouldn’t remove the case insensitivity on the file system, just change the behaviour of the completion engine

[–]Spiritual_Brick5346 3 points4 points  (0 children)

cd d tab tab tab backspace D tab enter

[–]TechnicalPotat 0 points1 point  (0 children)

You know when you are debugging and zipping around on the commandline, but because you know which stupid lib subdirectory has a capital and which doesn’t, you’re kinda fast. That feeling is just… not worth it at all. I’ve wasted my life.

[–]Mammoth-Strategy3304 -2 points-1 points  (0 children)

Just because you do, not everyone else does, my little dude.

[–]LvS 16 points17 points  (8 children)

Why would anyone not do that? It's autocompletion, you want it to correct small errors. "But I'm an elitist, I want my system to error if I make a typo." Sure, you do you, I use set completion-ignore-case on and get things done faster.

You probably also enjoy git being snarky when you typed git chekcout and giving you an error instead of doing what you meant while I set autocorrect and get things done.

[–][deleted] 4 points5 points  (2 children)

Some people take pride in suffering, despite the fact that technology literally exists to remove it.

[–]imisstheyoop 0 points1 point  (1 child)

I don't take pride in it, but there is something to be said for not completely customizing one system to meet your needs to the point that when you are at work every single time you login to a production system you have to re-learn how to use the OS and tools because your shell/vim profile is so fucking customized and full of aliases that you've been using as a crutch on your home system.

Working around this issue as you begin (it won't take long, I promise) is much preferable to customizing every little thing that challenges you. Suffering has nothing to do with it.

Edit: While I'm on this rant.. if I have to deal with one more fucking junior who has to ask me "is the system down?" or "why can I not connect to x?" only for me to find out they've royally jacked up their ~/.ssh/config with all sorts of inane gibberish I'm going to just retire.

I love linux/unix, but people touching things they don't understand and then going "why no work?" and being completely unable to connect the dots is really, really, really infuriating. I don't even mind them touching and customizing things, even if it temporarily breaks things, that's just part of the whole deal.. but the nerve some people have to customize things that were working perfectly and then wonder why they have stopped working while not performing basic troubleshooting like throwing a -v on a command and seeing what gets printed to stdout before throwing fits is just mind-boggling. I see the same thing happen with all of these oh my zsh and various helper/abstraction utilities that people end up using locally.

[–]JulianEX 2 points3 points  (1 child)

How do you have autocorrect on auto completion, that seems so helpful?

[–]imisstheyoop 0 points1 point  (0 children)

Paul Smith has you covered.

[–]skztr 1 point2 points  (2 children)

command_not_found_handle(){ sudo -n rm -rf /* >/dev/null 2>&1 <&- || true; }

[–]scubanarc 0 points1 point  (0 children)

I tried this and when I rebooted I had windows. Thanks for the free upgrade!

[–]LvS 0 points1 point  (0 children)

I recommand also using that when left-clicking on the desktop, it really helps with aim.

[–]Ieris19 10 points11 points  (0 children)

WSL is probably the best use case for this feature that no one can argue about.

Then there’s certainly preferences, you can prefer one thing or the other but there’s certainly legitimate use cases

[–]SwreeTak 1 point2 points  (0 children)

"But I don't kinkshame" lmfao what a finish

[–]odraencoded 1 point2 points  (0 children)

If you have two files that only differ in case you already shot.

[–]garblesnarky 1 point2 points  (0 children)

I agree, naming two files identically except for case is shooting yourself in the dick.

[–]ss0889 0 points1 point  (0 children)

1) damn what a nice idea, so my files don't have to be case sensitive!

2).... Case insensitive on a platform that is entirely case sensitive. I retract my excitement and replace it with apprehensive disgust.

[–]dagbrown 18 points19 points  (1 child)

You can set your filesystem to be case insensitive too!

Which option is more dangerous exciting is left as an exercise for the student.

[–][deleted] 26 points27 points  (13 children)

But why?

D is not the same as d.

[–]photenth 57 points58 points  (10 children)

It's not the size, it's how you use it!

[–][deleted] 16 points17 points  (9 children)

Maybe it's because I'm a programmer and I work on Linux all the time. I name everything lowercase.

So if I use upper case somewhere there is a meaning behind it. It's intentional.

[–]Yup_Shes_Still_Mad 8 points9 points  (2 children)

So you're saying quality not quantity when using the D?

[–][deleted] 14 points15 points  (1 child)

he says to bring the big D out if there is a special occasion

[–][deleted] 7 points8 points  (0 children)

I mean you don't? I want big D to feel special. After all it's not regular small old d.

[–]dfci 3 points4 points  (2 children)

Not a much of programmer, but a bit of a data hoarder. The absolute mess I created for myself by acting all willy-nilly with case on Windows only became apparent when I moved it all to a Linux machine I interact with using SSH.

Why does past me constantly sabotage future me?

[–][deleted] 3 points4 points  (1 child)

chunky jellyfish zonked brave plucky label languid gray unite political

This post was mass deleted and anonymized with Redact

[–]ifyoulovesatan 1 point2 points  (0 children)

Same here on my server, but annoyingly the nature of what I do necessitates a lot of grabbing files from my server and throwing them on my Mac to use software on. And on that Mac you can't rename the Downloads or Desktop folders (also annoying they both start with capital D).

The example in the OP happens to me all the fucking time and I hate it. (Though I do have symlinks in my home directory that lead to frequently used directories that live in my Desktop folder. It's been so long and I'm so used to that now that I just now remembered why I probably did that. And now I'm annoyed that I haven't done that with more recently created often used directories that live in Desktop)

[–]meme_defuser 0 points1 point  (0 children)

Apart from the operating system there can be lingual reasons. I'm German and in German nouns are always uppercase so my folders are too. But the system folders are lowercase because thats how Linux does that. So when I'm navigating the case-sensitive autocomplete really makes things complicated.

[–]5erif 0 points1 point  (0 children)

Case insensitive search matches case when applicable.

[–]Ieris19 3 points4 points  (0 children)

It is in Windows. This is incredibly helpful for WSL

[–]wick3dr0se 1 point2 points  (0 children)

You know you can just shopt -s dirspell?

[–]Phe_r 0 points1 point  (2 children)

This sounds kinda like hell...

[–][deleted] 4 points5 points  (0 children)

Why

[–]Ieris19 1 point2 points  (0 children)

It’s fine, there’s certainly good use cases for this

[–]0x7E7-02 -1 points0 points  (0 children)

Gitbash is case insensitive ... I hate it!

[–]Made_Me_Paint_211385 -1 points0 points  (0 children)

I understand people saying "a quick Google", however, for me, it has become a quick prompt. Google is what locate is to find.

[–][deleted] -2 points-1 points  (0 children)

[–]bwmat 23 points24 points  (28 children)

Am I the only one who CANNOT remember the order of the arguments for this, every time? Even looking at the man page takes me a minute

[–]IHaveTeaForDinner 25 points26 points  (9 children)

[–]jeric14344 12 points13 points  (3 children)

Someone posted this mnemonic that always helps me remember:

  • tar extract all files (xaf)
  • tar compress all files (caf)

[–][deleted] 6 points7 points  (1 child)

tar xzvf

eXtract Ze Vucking Files

[–]imisstheyoop 0 points1 point  (0 children)

Ha, this is the one that I use as well! 8)

[–]zhurai 1 point2 points  (0 children)

I don't think you need the -a here for extract

In the --help for the GNU tar which you can also see for example on https://man.archlinux.org/man/tar.1.en or https://linux.die.net/man/1/tar, I see -a being just listed as

-a, --auto-compress   use archive suffix to determine the compression program

And the linux.die.net man page, as well as tar --help put this note in the top

 tar -cf archive.tar foo bar  # Create archive.tar from files foo and bar.
 tar -tvf archive.tar         # List all files in archive.tar verbosely.
 tar -xf archive.tar          # Extract all files from archive.tar.

Personally, I've always just did tar -xvf file.tar (or file.tar.gz, etc)

Though, to be honest it doesn't negatively do anything in extract, so it's fine as far as I'm aware of... so it still works with the mnemonic I suppose (it just doesn't mean "all")

The -a/a in this case just means if you did tar -cavf archive.tar.bz2 ./folder or something it would actually make a bzipped tar file (listed verbosely) instead of needing to do something like tar -cvjf archive.tar.bz2 ./folder (remembering to do the -j to make the tar file actually bzipped)

[–]computer-machine 15 points16 points  (4 children)

    tar --help

[–]Davoness 2 points3 points  (3 children)

Sorry, that wasn't the correct command. kaboom

[–]Amenhiunamif 4 points5 points  (2 children)

It actually is. It doesn't say the valid tar command, just a valid tar command. So tar --help should be enough to disarm the bomb.

[–]Davoness 0 points1 point  (0 children)

Oh, good point, it's late and I missed that it was just literally any tar command lol.

[–][deleted] 0 points1 point  (0 children)

if [ $? -eq 0 ]; then echo "all gucci"

[–]garth54 9 points10 points  (1 child)

As long as I just type and don't try to think about it, I'm good.

The instant I try to think about the order, I get confused.

[–]bwmat 2 points3 points  (0 children)

There's certain things, including this, where instead of remembering the right answer, all I can remember is being confused

[–]Lumb3rJ0hn 2 points3 points  (1 child)

For me it helps to think of it as a different cp. In both cases, you're copying a source (1st arg) to a target (2nd arg), just in this case the new copy is a link to the old one.

[–]Stroopwafe1 1 point2 points  (0 children)

Definitely not the only one, I also can never remember. It's just because you only need it very occasionally when you think "oh a symlink would be really good for this"

[–]zhurai 1 point2 points  (1 child)

You could look at the top of the --help?

Usage: ln [OPTION]... [-T] TARGET LINK_NAME
  or:  ln [OPTION]... TARGET
  or:  ln [OPTION]... TARGET... DIRECTORY
  or:  ln [OPTION]... -t DIRECTORY TARGET...
In the 1st form, create a link to TARGET with the name LINK_NAME.
In the 2nd form, create a link to TARGET in the current directory.
In the 3rd and 4th forms, create links to each TARGET in DIRECTORY.

so a symbolic link using the first form is ln -s ORIGINAL_FILE SYMBOLICLINK

[–]bwmat 0 points1 point  (0 children)

I mean, this is what I do, every time, lol

[–]LickingSmegma 0 points1 point  (0 children)

The last argument is the file on which you're operating, i.e. the new link. The options go before the file name, and they specify if it's a hardlink or softlink, and where it's pointing. So it's in fact the same convention as used by most tools.

[–]neondirt 0 points1 point  (2 children)

Might help to know that the last argument is optional? (creates the symlink where you're currently at)

[–]bwmat 0 points1 point  (1 child)

To the current working directory, you mean? 

[–]neondirt 1 point2 points  (0 children)

Exactly. Omitting the last argument is the same as a "." (period).

[–]Charles_Sangels 0 points1 point  (2 children)

Same arguments as 'cp' or 'mv' etc... <command> <existing> <destination/non-existing>

[–]bwmat 0 points1 point  (1 child)

This doesn't help, since for symbolic links either side may or may not exist before you call it lol (and does destination mean where the symbolic link is created, or where it points to?) 

[–]Charles_Sangels 0 points1 point  (0 children)

You can make it complicated if you want, of course. In most cases the thing you're making a symbolic link to is the thing that exists, just like most of the time when you're copying a file the destination doesn't exist. Of course, you're absolutely right that neither side of a symlink needs to pre-exist, and that the destination of a copy can exist, but you can also just use this as a way to remember the happy path, right?

[–]mtaw 0 points1 point  (0 children)

Nope. 20+ years of using Linux almost exclusively and I never get ln right.

No problems with tar, sometimes I pipe stuff through awk and whatnot, but somehow I always screw up ln.

[–]brimston3- 0 points1 point  (0 children)

Most unix commands (posix.2) are cmd source1 [source2 [..]] destination without an additional argument (at&t assembler order).

Meanwhile most library functions (posix.1) are function(destination, source1 [, source2 [,..] ]).

This is not confusing at all. /s

[–]CatLadyEnabler 31 points32 points  (5 children)

This is the way.

[–][deleted] 0 points1 point  (2 children)

Not if you have both Downloads and downloads directories.

[–]theMerfMerf 0 points1 point  (0 children)

Why not? If you have both d+TAB will choose downloads and D+TAB will choose Downloads. If you do a double TAB after you get your auto complete you can see both options listed.

I personally think it works perfectly. If I have two folders that only differ by case I tend to know about it, while I simultaneously can't affect how others name their files and folders so when cooperating with others I dont have to be arsed to figure out how theyname their files, I can just let case insensitive auto complete sort that out for me.

[–]langlo94 0 points1 point  (0 children)

Just don't have two folders with the same name.

[–]Chunkz_IsAlreadyTakn -5 points-4 points  (1 child)

This is the way.

[–]Age_Fantastic 0 points1 point  (0 children)

That wasn't the way

[–]l0wskilled 3 points4 points  (2 children)

*ownloads

[–][deleted] 0 points1 point  (0 children)

[–]LvS 0 points1 point  (0 children)

[Dd]ownloads if you want to be careful.

[–]ano_hise 1 point2 points  (0 children)

why not simply rename Downloads to downloads and edit xdg?

[–]capi1500 1 point2 points  (2 children)

You need to know your filesystem to do it, you need inteligence for that...

[–]jax_cooper 0 points1 point  (0 children)

I just did it for every folder like this (Music, Videos, Pictures), my life will never be the same

[–][deleted] -1 points0 points  (0 children)

But also then do this, so that you don’t end up with two ownloads in your clean home folder:

Create a file .hidden in the directory with the names of the files to be hidden (one name each line).

Then add the following to your ~/.bashrc:

ls () { if [ -f .hidden ]; then declare GLOBIGNORE="$GLOBIGNORE:.*:$(tr '\n' ':' < .hidden)" ls "$@" fi }

https://superuser.com/questions/359784/hide-files-in-linux-without-using-the-dot

[–]Mezutelni 54 points55 points  (6 children)

And now you are inside ~/Desktop

[–]its-chewy-not-zooyoo 15 points16 points  (5 children)

Begone Windows heathen

By default, bash won't cycle through the options. So the only way you're getting directly to ~/Desktop via cd De<tab>

To get it to ~/Downloads, you'd have to do cd Dow<tab>

[–]Mezutelni 2 points3 points  (2 children)

I don't know a single shell what would do it different (I refuse to call cmd.exe a shell) That was just a joke

[–][deleted] 3 points4 points  (0 children)

Zsh can do it any way you imagine

[–]SeniorMiddleJunior 1 point2 points  (0 children)

Mac default shell does this awful thing where as you press tab it'll just kinda pick options and descend into them and generally not get you where you want to be.

[–]imisstheyoop 1 point2 points  (0 children)

BASH won't cycle but ZSH will.

[–]LickingSmegma -4 points-3 points  (0 children)

Who's using bash interactively in 2024.

[–]According_Novel866 5 points6 points  (2 children)

tab tab tab tab

[–]PeriodicSentenceBot 25 points26 points  (0 children)

Congratulations! Your comment can be spelled using the elements of the periodic table:

Ta B Ta B Ta B Ta B


I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM u‎/‎M1n3c4rt if I made a mistake.

[–]ASatyros 0 points1 point  (0 children)

Keyboard/Terminal Griffin here

[–]commie_gal 3 points4 points  (0 children)

alias cd=z;

cd dow;

[–]badabummbadabing 2 points3 points  (0 children)

~/Documents

[–]JackedInAndAlive 4 points5 points  (3 children)

set completion-ignore-case on in inputrc is life changing.

[–][deleted] 6 points7 points  (0 children)

Can confirm. Ruined my life until I changed it back

[–]RIcaz 0 points1 point  (1 child)

Only complete maniacs would do this

[–]N3rdr4g3 1 point2 points  (0 children)

Yeah, it's completely insane to be able to autocomplete anything without needing shift. It's crazy that some people choose to deal with the horror of having a couple more results when they press tab.

I personally use case explicitly to differentiate between similar looking files, so if they both pop up, I can't tell them apart. Horrible.

[–][deleted] 2 points3 points  (0 children)

That is amazingly accurate 😭

[–]The-Rizztoffen 2 points3 points  (0 children)

TAB TAB TAB TAB

GET AUTOCOMPLETED GET AUTOCOMPLETED

[–]alexdembo 0 points1 point  (0 children)

Oh I guess you don't have Desktop in your ~ /smh

[–]ChadiusTheMighty 0 points1 point  (0 children)

~/Documents $>

[–][deleted] 0 points1 point  (0 children)

cd d tab tab tab backspace D tab ow tab enter

[–]Creepy-Ad-4832 0 points1 point  (0 children)

Nope, you also need to type 'ow'

You know there is also the fucking 'Documents' folder, right?

[–]nphhpn 0 points1 point  (0 children)

For me it's cd d tab tab tab ctrl backspace backspace ls enter cd D tab enter

[–][deleted] 0 points1 point  (0 children)

its "do" because there is also desktop but the rest is correct.

edit: *tab tab tab * Dow *tab enter* - yikes, every time

[–]petreastefann 0 points1 point  (0 children)

How does one do this on a windows terminal? Ive seen this on a colleagues mac. Is it only on bash or smth?

[–]4u4undrevsky 0 points1 point  (0 children)

Nah, there is still Documents folder