• darcy
    link
    fedilink
    92 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

    • @[email protected]
      link
      fedilink
      102 years ago

      You could just use aliases in your bashrc

      alias dl=cd ~/Downloads

      Might need quotes around the command.

      • darcy
        link
        fedilink
        12 years ago

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

        • @[email protected]
          link
          fedilink
          22 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

        • MrScottyTay
          link
          fedilink
          English
          12 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

          • darcy
            link
            fedilink
            12 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)

            • MrScottyTay
              link
              fedilink
              English
              22 years ago

              Oh, yeah i think i also confused them with symlinks, you could use them?

  • @[email protected]
    link
    fedilink
    1282 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.

    • @[email protected]
      link
      fedilink
      72 years ago

      Lower case directories?

      Eww

      ILikeMineInAWayICanReadThemProperly, instead of ilikemineinawayicanreadthemproperly

      • @[email protected]
        link
        fedilink
        142 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

  • MerfMerf
    link
    fedilink
    532 years ago

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

    • PupBiru
      link
      fedilink
      16
      edit-2
      2 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?

      • MerfMerf
        link
        fedilink
        22 years ago

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

    • UFO
      link
      fedilink
      12 years ago

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

    • @[email protected]
      link
      fedilink
      22 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.

      • @[email protected]
        link
        fedilink
        12 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 :)

      • MerfMerf
        link
        fedilink
        12 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.

    • janAkali
      link
      fedilink
      English
      82 years ago

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

  • @[email protected]
    link
    fedilink
    82 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.

            • @[email protected]
              link
              fedilink
              English
              92 years ago

              I’ve been using case insensitive fs on macOS for years and the only software having issues with this is onedrive.

              can’t say i’m surprised.

              • @[email protected]
                link
                fedilink
                4
                edit-2
                2 years ago

                I have issues with Docker a lot. Example: Rename a file from “File.js” to “file.js” in a dependency and it’s like something caches the old name so even when I redownload or install that dep it tries the old name and fails to find the file. Might just be me and my tomfoolery

                • @[email protected]
                  link
                  fedilink
                  42 years ago

                  if you’re renaming from File.js to file.ts, which is also changing suffixes instead of just capitalization, then that couldn’t be explained by case sensitivity, unless it was a typo and you meant File.js to file.js

                • @[email protected]
                  link
                  fedilink
                  12 years ago

                  This is likely because docker runs Linux in a VM on MacOS right?

                  We’ve had similar problems with stuff that works on the developers Mac but not the server which is case sensitive. It can be quite insidious if it does not cause an immediate “file not found”-error but say falls back to a default config because the provided one has the wrong casing.

              • @[email protected]
                link
                fedilink
                12 years ago

                Which part? I’d love to switch if there’s no reformatting, and if your exception is with the first part, I’d ask for some evidence. All of my mac machines arrived brand new, case insensitive. Granted that’s only 3 so far, but it’s a smattering from 2019 onward. All the literature online points to this being the default too

      • @[email protected]
        link
        fedilink
        10
        edit-2
        2 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.)

        • lnee
          link
          fedilink
          12 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

          • @[email protected]
            link
            fedilink
            12 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!