I realized I always make a source folder under home and then subfolders named after programming languages to organize projects but then I realized I somehow had my own convention for how to store my source code and I have no idea where I got it from

Then I thought. what about other Linux users ?

What sorts of conventions do you have that pertains to folder structure in Linux ?

  • mbirth 🇬🇧@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    My home folders on any OS have a Development folder (which conveniently sits right next to Documents and Downloads) and in that folder, I’ve also got subfolders per programming language that have the respective projects in them.

    The other folder I usually have is SyncThing with whatever synced folders are relevant for that machine.

    • astronaut_sloth@mander.xyz
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      Yep, I also have a directory for my programming projects on each of my machines, but mine is Programming. On my main desktop, I also have an ISOs folder to hold my OS ISOs for VMs and old CD-ROM game ISOs.

  • TropicalDingdong@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    I just live out of my downloads folder until its time to back up the important stuff to the server and reinstall/ distrohop.

  • skankhunt42@lemmy.ca
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    I have /home/username/username/ and I sym link important dirs (like Downloads) to my new home. I strongly dislike all the dot files and dirs cluttering up my home dir.

    • RiderExMachina@lemmy.ml
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      Are you aware of the ‘xdg-user-dirs-update’ command that allows you to edit the ~/.config/user-dirs.dirs config file?

        • pemptago@lemmy.ml
          link
          fedilink
          English
          arrow-up
          0
          ·
          2 months ago

          Not the commenter you replied to, but I change my XDG directory names to be lowercase and start with different letters. For example, Desktop, becomes “drop” (as in pick it up and put it somewhere else) and Downloads is a subdirectory dl. A program that would otherwise save to “Downloads” now saves to “~/drop/dl”. When I setup my machines I run a script including the line xdg-user-dirs-update --set DESKTOP "drop" to update the XDG directory and I delete “Desketop”. So og commenter has the option of updating their userdirs to be nested in their username if they wanted to avoid symlinking. Here’s the relevant arch wiki page and xdg freedesktop page.

          • AnarchistArtificer@slrpnk.net
            link
            fedilink
            English
            arrow-up
            0
            ·
            2 months ago

            I don’t use Arch, but I am eternally grateful for their excellent documentation.

            I am also grateful to you for your comment, because this is a good idea

        • RiderExMachina@lemmy.ml
          link
          fedilink
          English
          arrow-up
          0
          ·
          2 months ago

          Reading back, my comment sounds snarky, but I was genuinely trying to be helpful.

          Like what pemptago was describing, instead of symlinking your directories to /home/username/username, you could simply update that file and achieve the same effect, but in a more “official” way that may prove more robust.

        • Grey Cat@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          2 months ago

          It basically allows you to define which paths are used for the Downloads, Documents, Videos, etc… types of directories.

  • BCsven@lemmy.ca
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    Hardware folder (synced via sync thing). All hardware PDFs, notes images etc get subfolders by manufacturer. It is helpful for keeping track of use manuals, firmware or config settings for each piece of hardware.

    • hushable@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      I have a ~/Sync folder with a symlink to all my Syncthing shares, which I have quite a lot of. Helps me find them quickly and reminds me that everything in there us pulled or pushed somewhere else.

  • morto@piefed.social
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    I always make a bin folder in my home for putting my custom scripts and downloaded binaries. At least on fedora, ~/bin is already in the path, so I don’t have to make any additional configuration to make stuff in there become commands for my cli

    • thejml@sh.itjust.works
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      I want to follow this, and I sorta do… but ADHD makes the P,A and other A basically the same category. And the R is just “stuff I put down to look at but haven’t yet”.

      • www-gem@lemmy.ml
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        Drawing the line between each category indeed takes some time. Our brain is not use to this approach anymore. Perseverance is key, but it’s kind of a commitment.

  • phaedrus@piefed.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    I do a similar thing for code stuffs, generally always make a ~/Git and ~/Godot so I always have a spot for things.

    I also delete most of the auto-created ones if I’m using a DE that does that, because I have my own organization going on with various external/network drives. Only one I have always kept is ~/Downloads.

      • phaedrus@piefed.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months ago

        I’m not sure exactly what you’re asking about. Do you mean the directory names?

        In unix, ~ expands to the user’s home directory path and / just separates each level in the path.

        • TrickDacy@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          2 months ago

          Very weird. For some reason Boost displays those like the strings I wrote. Looking at this in the web client now, I see ~. Which btw I’m familiar with :) Thanks for the response!

          • phaedrus@piefed.world
            link
            fedilink
            English
            arrow-up
            0
            ·
            2 months ago

            Ohhh, very odd. I’ve been noticing a lot of inconsistencies between Lemmy and PieFed like this, and now an app is something else entirely. Seems the fediverse is not unified on markdown support!

            Apologies if I came off as condescending, not my intention.

  • ZWQbpkzl [none/use name]@hexbear.net
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    I generally follow the same pattern as you. ~/Code with programming language based sub folders. But there’s also a ~/Code/Work and ~/Code/Orgs which is for code that has a certain purpose. Generally the by-language subfolders are for projects I cloned, not authored. There is a fair amount of symlinking also.

    Also /data for long term storage drives. Directories under ~/Audio and ~/Video will usually symlink to there.

  • monovergent@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    ~/.drafts, in which my text editor taskbar shortcut script creates files YYMMDD_text_N. I passionately believe in eliminating the chore of manually naming my spur-of-the-moment notes and text files.

    ~/progs or ~/bin where loose programs not provided by my package manager reside.

    If there’s a secondary drive, /media/disk1 as the mount point in fstab.

  • Dave@lemmy.nz
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    Multiple people in this topic say they organise in directories for different programming languages, something I have never considered and I find it to be an odd way of organising for some reason I can’t explain.

    Where do you put a project with a Javascript frontend and a Python backend?

    • underscores@lemmy.zipOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      for me I consider that a web project so it goes into the typescript folder, if it’s backend only then python

      • Dave@lemmy.nz
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        Why group it into language instead of say a ‘web’ directory or ‘android’/‘mobile’?

        I’m just curious, I am more of a ‘throw everything in one directory and home I remember what I’m looking for’ sort of organiser.

        • Grey Cat@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          2 months ago

          Honestly it’s a pretty good way of compartmentalizing projects in your mind.
          You usually remember pretty well what language your wrote a project in.
          And if you want to find a project again you just have to look in that language’s directory.

          Second advantage is that if there’s a language you only fucked around a little for fun, it doesn’t clutter the directories of your most used languages.

        • underscores@lemmy.zipOP
          link
          fedilink
          English
          arrow-up
          0
          ·
          2 months ago

          for me the project exists because I thought “id like to play with <language> today” but not necessarily “I want to make a <platform> project”

        • vandsjov@feddit.dk
          link
          fedilink
          arrow-up
          0
          ·
          2 months ago

          I agree, just have it by project. Otherwise I might have to look in different folders to find something. And what does it add, that something is grouped by language?

    • Starfighter@discuss.tchncs.de
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      Since projects of the same language often use the same tooling this makes it easier to clean up the whole directory by running something like this:

      for d in ./*/ ; do (cd "$d" && somecommand); done
      

      somecommand could be cargo clean if you’re in the Rust directory for example.