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 ?
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?
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.
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...)
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.
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.
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.
~/.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
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.
~/autoclean and a cron job to delete everything older than 7+ days from there. I can just download whatever, throw it in a special folder and it's gone after few days. Keeps my ~/Downloads a bit more clean, easy to store temp txt files to keep track of what I currently have on hand and so on.
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
~/.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.
Your organization will vary with your usage. If you're looking for something suitable for work, I would highly recommend the PARA approach.
https://fortelabs.com/blog/para/
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".
~/diy for my collection of knitting, crochet and sewing patterns and other assorted diy stuff
~/work duh.
~/tools for my collection of more or less useful small scripts
~/sync for my syncthing folders
~/data symlink to my data partition (most of the others are also symlinks to their location on data)
I don't really have a convention for programming projects yet. They used to land inside of ~/diy or in ~/tools or just random folders on data. I've got a ~/code folder now, but its contents are a mess.
Always backup your tools folder... In the past I only created backups for my "real" code folder and I was quite upset when I lost my small scripts in the last drive death.
~/Brojetos (anything relating to making stuff, writing, drawing, video creation, programming, etc., professional or personal)
~/temp (a non-hidden temp folder with a script that wipes it when the PC shuts down or reboots, used for downloads and such to prevent the "downloads folder is an abomination" problem that plagues any computer after a while of usage)
~/AppsGames (appimages, applications compiled from source and not installed to system, personal use scripts, wineprefixes, non-steam games)
aaaand ~/OtherAminals (for stuff I want to keep but have no idea where else to place)
top 50 comments