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 ?

  • Digit@lemmy.wtf
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 days ago

    Uh-oh… I’m going to answer this. n_n

    99% just dirs in ~/. ( Does making new dirs in /bedrock/strata count when manually adding strata? That’ll be about all there is in the other 1%. )

    • ~/bin
    • ~/gittings
    • ~/gittings/Digit (where I keep my local copies of my own git repos)
    • ~/images
    • ~/images/scrots
    • ~/images/ all the different things like dsktpbckgrnds, charts, memes, photos, gifs, etc & EDITS where I save most GIMP file artwork
    • ~/sounds
    • ~/.fonts (if the system does not create this already… so I can put my big tiny font collection “dbtfc” of otb and ttf fonts I made, in there, and have them “just work”).

    Oh, and this one’s a little fun:

    • ~/testdir in which i make a dir, a file, a media file, an executable, a fifo, a symlink, and a broken symlink, so I can ls that dir to see how everything looks in new themes.

    And locations for my sshfs mounts and external drives (faster to type than putting them each in ~/mount or ~/media or ~/mnt).

    • ~/bb
    • ~/o
    • ~/m or ~/t as symlinks to ~/mozart and ~/tyson depending on if on tyson or mozart. (I name my thinkpads after famous people born on the same day it arrives in the post).

    And then on bb external hd, loads of dirs, some notable ones

    • ./bkps
    • ./software
    • ./software/distros (where I store ISOs and system tarballs)
    • ./software/configs/ ; crypto/ ; doc/ ; games/ ; langs/ ; other/ ; virtuals/
    • ./cinema/
    • ./cinema/library (hiding the library in cinema, so I see it more often ;D)
    • ./cinema/_docu (for documentaries, lectures, interviews, etc)

    And on the webserver

    • ~/web
    • ~/web/stuff
    • ~/stuff (symlink to ^, that I use like my own personal pastebin) (… ~/o/stuff, from local machine).
  • homura1650@lemmy.world
    link
    fedilink
    arrow-up
    12
    ·
    edit-2
    6 days ago
    • /ram - tmpfs filesystem
    • ~/.local/bin - added to my path
    • ~/.local/software - any user-local program more complicated than a binary gets a directory here. Generally a binary would be symlinked to ~/.local/bin
    • ~/.local/venv - shared python venv to use for one liners and small scripts
    • ~/repo - local filesystem backed package repository for which the host system is configured to install from
    • ~/.local/repo - local filesystem backed package repository for which the host system is not configured to install from (used for mock, VMs, and external systems).
    • /overflow - Used to point to a large secondary hard drive (back when having a small ssd was the economical thing to do. Nowadays, it is just where my large directories go cause I can’t be bothered to get used to a more sane setup
  • Strit@lemmy.linuxuserspace.show
    link
    fedilink
    arrow-up
    7
    ·
    edit-2
    7 days ago

    I usually create ~/git/{github,gitlab,codeberg,AUR,etc} where I clone the git stuff I need.

    The rest is usually handled by my nextcloud that creates the ~/Nextcloud folder.

  • Renohren@lemmy.today
    link
    fedilink
    arrow-up
    2
    ·
    5 days ago

    Separate folders in the download one. One for each app. And a separate /home/sync folder with the same app separation folders to safekeep the backups of android apps and DCIM folder.

  • owsei@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    5 days ago

    ~/code for code

    ~/dots for git-backed nix configs

    ~/.rt for projects compiled locally (“runtime”)

    ~/Screencast for recordings of my screen

    I also create a ~/.shrc.bash symlink that points to ~/dots/bash/bashrc that reats ~/dots/bash/*.bash and sources the files

    ~/.shenv.bash where I keep environment (computer) specific settings

  • hushable@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    7 days ago

    From back when I used to freelance as a photo and video editor. ~/Media which was a mount point for my second hard drive with all the personal and paid customer’s I was working on, it was a mix of Music, Photos and Videos that I was creating, but not consuming if that makes sense.

    Just a remnant from back when I had a small SSD with my OS and a second larger mechanical drive for everything else

  • utopiah@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    7 days ago
    • ~/Prototypes for … my prototypes, typically either starting from an empty directory or cloning a repository and adapting it for my needs. I have this directory on nearly all my devices, desktop of course but also NAS, server, phone, standalone XR headset, etc.
    • ~/Apps in addition to ~/bin, typically binaries but all AppImages
  • oscardejarjayes [comrade/them]@hexbear.net
    link
    fedilink
    English
    arrow-up
    1
    ·
    7 days ago

    A projects folder, usually. All the other folders at the root of $HOME are created by some application or another (XDG folder creator, applications that don’t respect XDG).

    I make a YouTube subfolder to be downloaded YouTube videos in, and subfolders for podcasts, but those aren’t at the root of $HOME.

  • Ricaz@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    33
    arrow-down
    1
    ·
    7 days ago

    My homedir is an infernal hellhole of junk accumulated over the past 15 years and I wouldn’t have it any other way

    • TriangleSpecialist@lemmy.world
      link
      fedilink
      arrow-up
      16
      ·
      7 days ago

      I’d love to keep it clean but too many devs think $HOME is up for grabs, as long as they prepend their directory names with a dot (they think I’ll never notice, but I notice, and I keep a list…)

    • Random Dent@lemmy.ml
      link
      fedilink
      English
      arrow-up
      10
      ·
      7 days ago

      Mine used to be like that, but now my home folder is rehabilitated by turning ~/Documents into a hellhole of accumulated junk instead.

      • Random Dent@lemmy.ml
        link
        fedilink
        English
        arrow-up
        2
        ·
        7 days ago

        You can also just make a file called .hidden and paste the names in there and it’ll hide them, that way it doesn’t mess up any paths/symlinks etc. Or at least in KDE/Dolphin you can do that, I dunno about other setups.

    • communism@lemmy.ml
      link
      fedilink
      arrow-up
      4
      ·
      6 days ago

      Mine used to be the same but the last OS reinstall I reset everything, moved my files onto an external drive, and only copied them over on a needs basis. I’d been keeping the same home dir since I was like 4 or however old I was when I started using a computer. So needless to say there was a lot there that made me cringe to see every time I tried to navigate my files.

  • Dave@lemmy.nz
    link
    fedilink
    arrow-up
    30
    ·
    7 days 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
      7
      ·
      7 days 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
        12
        ·
        7 days 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
          6
          ·
          7 days 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.

        • vandsjov@feddit.dk
          link
          fedilink
          arrow-up
          3
          ·
          7 days 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?

        • underscores@lemmy.zipOP
          link
          fedilink
          English
          arrow-up
          3
          ·
          7 days 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”

    • Starfighter@discuss.tchncs.de
      link
      fedilink
      arrow-up
      3
      ·
      7 days 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.

  • mbirth 🇬🇧@lemmy.ml
    link
    fedilink
    arrow-up
    30
    ·
    7 days 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.

  • KaChilde@sh.itjust.works
    link
    fedilink
    arrow-up
    22
    ·
    6 days ago

    ~/Homework (porn)

    ~/aaaaaaa (porn)

    ~/Stuff (memes, with a porn subfolder)

    ~/misc (work docs, study docs, forms, some porn)

      • Sims@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        2 days ago

        I could be wrong, but it seems he just mounted ‘/porn’ directly as ‘/’ ? Efficient, I guess.

        …actually, there seem to room for more improvements; I’m not sure there’s any need for an ‘operating system’ on the system - a small fap-app ™ could likely handle all content on the system ? Work documents could be injected in to the fap-stream © when he needs to stop ? That would release many gb for even more fap-ability © ?

  • skankhunt42@lemmy.ca
    link
    fedilink
    arrow-up
    12
    ·
    7 days 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
      9
      ·
      7 days 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
          10
          ·
          7 days 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
            3
            ·
            5 days 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

        • Grey Cat@lemmy.world
          link
          fedilink
          English
          arrow-up
          5
          ·
          7 days ago

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

        • RiderExMachina@lemmy.ml
          link
          fedilink
          English
          arrow-up
          5
          ·
          7 days 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.