this post was submitted on 09 Dec 2025
131 points (97.8% liked)

Linux

63531 readers
478 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
 

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 ?

(page 2) 50 comments
sorted by: hot top controversial new old
[–] olafurp@lemmy.world 5 points 2 months ago (1 children)

I just at ~/projects it contains a boat load of stuff including my Neovim and bash stuff.

Guys, use GNU Stow + git for your configs shit's good.

[–] victorz@lemmy.world 2 points 2 months ago* (last edited 2 months ago)

Have you tried chezmoi?

[–] stupid_asshole69@hexbear.net 4 points 2 months ago

Especially for systems remotely managed by ssh:

~/Desktop/stuff/mystuff/junk/funny/

[–] fum@lemmy.world 4 points 2 months ago

~/bin/ which I add to my $PATH

[–] Lettuceeatlettuce@lemmy.ml 3 points 2 months ago* (last edited 2 months ago)

~/Repos (For all the github and other code repositories I work in)

~/Scripts (All my random Bash scripts, sometimes for testing out stuff)

~/Junk (Mostly used for testing programs or small project components that aren't mature enough to have their own repo)

[–] DieserTypMatthias@lemmy.ml 3 points 2 months ago (1 children)
  • ~/Documents/incubator for my personal projects.
  • ~/Documents//<user/org>/ for contributing/working on my saved projects
  • ~/Documents/schule for school
[–] IanTwenty@piefed.social 2 points 2 months ago

This dir structure for git projects is the best one I think, especially if managing multiple identities/git configurations. Git has a 'includeif' to change your setup depending on which dir you are currently in:

https://git-scm.com/docs/git-config#_includes

[–] golden_zealot@lemmy.ml 3 points 2 months ago

Under ~ I usually make ~/Application for flatpaks/appimages etc, ~/Script for any kind of script I write in bash, python, or whatever else, ~/Audio for audio/music production stuff, and ~/Games for emulators and such. ~/Documents is reserved for actual documents containing text data usually.

[–] mko@discuss.tchncs.de 3 points 2 months ago

For source code or any project - a folder Projects (on my personal setups) or Documents/Projects/PersonalRepo (more customer specific folders under the Projects sub-folder)

  • Anything under ~/Projects that isn’t just a throwaway will be a git repo.
  • Anything under ~/Documents/Project/*Repo will be a git repo.
[–] phaedrus@piefed.world 3 points 2 months ago* (last edited 2 months ago) (5 children)

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.

load more comments (5 replies)
[–] tyler@programming.dev 3 points 2 months ago

~/dev

~/dev/oss

~/dev/work

~/dev/personal

[–] hexagonwin@lemmy.sdf.org 3 points 2 months ago

i have a 'src' directory. tho my home directory is extremely messy, ls | wc -l gives me 170 now..

[–] ZWQbpkzl@hexbear.net 3 points 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.

[–] utopiah@lemmy.ml 3 points 2 months ago* (last edited 2 months 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
[–] communism@lemmy.ml 2 points 2 months ago

~/{nextcloud,git,pictures/screenshots,music,docs,videos}

In terms of what I manually create. Dot directories normally get automatically created but I guess I'd create a ~/.config if it didn't get created.

[–] Penguincoder@beehaw.org 2 points 2 months ago* (last edited 2 months ago)

Conventions I have are:

  • Downloads folder is ephemeral, don't store/keep things in there I might want
  • ~/scripts - personal scripts and one offs
  • ~/Documents/projects/[subdir] - any tech project I may be working on, gets homed here
  • /tmp - always mount it noexec

I also start off allocating ~ 50GB to / (root) volumegroup. Wine and proton have been taking up nearly the full space though, may need to expand it on my desktop soon.

[–] Digit@lemmy.wtf 2 points 2 months ago* (last edited 2 months 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).
[–] iamlyth@beehaw.org 2 points 2 months ago

~/nixos/ for my NixOS config ~/repos/ for git repos ~/audio/ for my sound library and recordings

[–] hushable@lemmy.world 2 points 2 months ago* (last edited 2 months 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

[–] northernlights@lemmy.today 2 points 2 months ago (1 children)

$HOME/temp, $HOME/git, ln -s $HOME/git/scripts $HOME/scripts

[–] qjkxbmwvz@startrek.website 4 points 2 months ago

I'm a ~/tmp man myself.

[–] beerclue@lemmy.world 2 points 2 months ago

I have ~/work/code/project-name-1, ~/work/code/project-name-2 or ~/priv/code/project-name-3, but not by language... I only separate work and private repositories.

[–] Renohren@lemmy.today 2 points 2 months ago* (last edited 2 months 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.

[–] NutWrench@lemmy.world 2 points 2 months ago

~/Transfer

for SyncThing

load more comments
view more: ‹ prev next ›