this post was submitted on 29 Mar 2025
16 points (100.0% liked)

Linux

6786 readers
183 users here now

A community for everything relating to the GNU/Linux operating system

Also check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 2 years ago
MODERATORS
 

I have separate directories for uni courses, which are grouped in semester directory. I also TA some classes, which is stored in separate folder named 'TA'. That is, it is grouped like this:

University
| - ...
| - 2024.2
| | - Lie algebra
| | - Operator algebra
| - 2025.1
| | - Mathematical Algorithms
| | - Diophantine equations
| - TA
| | - ...
| | - 2024.2
| | - 2025.1

Oftentimes, I focus on the current semester, so I want to view courses on a same semester grouped together. On other times, I want to group TA activities across semesters together to . I may also do the same with grouping similar subjects.

Basically, I want to view directories with different grouping for each use case, as in the title. I hope this makes sense.. Is there any kind of directory structure or application-based solutions for this cases?

EDIT: I want both GUI and TUI solution for browsing files like this, it's great if linux filesystem supports this natively but fine if it doesn't. Database with redirection capability would be even better.

Thanks in advance!

all 14 comments
sorted by: hot top controversial new old
[–] lvxferre@mander.xyz 6 points 2 days ago (1 children)

I had a similar problem and I solved it through a tagging tool, tmsu The tool works through the terminal but it has a virtual file system, so you can access your files from a GUI file manager. I recommend you to check it out, it might solve your problem.

[–] someacnt@sh.itjust.works 3 points 2 days ago* (last edited 2 days ago) (2 children)

Thanks a lot, this seems exactly the thing I want!

[–] lvxferre@mander.xyz 5 points 2 days ago (1 children)

I hope it works for you!

In the worst hypothesis, if tmsu doesn't work for your needs, then @deegeese@sopuli.xyz's idea (parallel directory tree with symlinks) sounds solid. Or even flattening the directory tree that you already use, like:

University
| - ...
| - 2024.2 Lie algebra
| - 2024.2 Operator algebra
| - 2024.2 TA activities
| - 2025.1 Mathematical Algorithms
| - 2025.1 Diophantine equations
| - 2025.1 TA activities

This way if you want to find e.g. all dirs with TA, you just Ctrl+F "TA activities" and it'll show you both "./2024.2 TA activities" and "./2025.1 TA activities".

[–] enemenemu@lemm.ee 2 points 2 days ago

That's smart, thx

[–] sxan@midwest.social 2 points 2 days ago

I can second tsmu. However, it does require some thoughtful use.

I usually compare it to GMail, which was the pioneer of eliminating folders. notmuch also does a good job here. tmsu isn't quite as effortless - granted, it has a harder job in having to support multiple file types, not all of which are automatically indexable - but for tmsu to be effective I find I have to make extra (non-trivial) effort to manually tag files. Rather than, say, gmail and notmuch, where I only care about tags when I'm searching. buku is similar, although it's somewhere in between; you can get by without manually tagging, but it isn't perfect, and manually tagging is still better and isn't a much extra work.

[–] deegeese@sopuli.xyz 4 points 2 days ago (1 children)

You’re describing a database which points to resources. A file system is hierarchical.

If you really want, you could build a parallel dir tree filled with symlinks to the real files.

[–] someacnt@sh.itjust.works 1 points 2 days ago (1 children)

Thanks, I realized what I really want is database with "redirection" to resource. That is, it is organized as a database, but I can also open the target file in usual file browser.

What is a good GUI application for this purpose? Options in both GUI and TUI would be great!

[–] deegeese@sopuli.xyz 2 points 2 days ago

You could do a spreadsheet with cells containing a file:// URI

[–] HelloRoot@lemy.lol 2 points 2 days ago

Dolphin (kde) tagging

[–] e0qdk@reddthat.com 3 points 2 days ago (1 children)

You can do this using links. e.g. ln -s TARGET LINK_NAME to make symbolic links on the command line, or (usually) by holding some key while dragging a file/folder between windows in your preferred GUI file manager.

I have something related set up with a small Python script to automatically create new files and update the links for tracking my weekly work notes (pseudo-timecard, basically).

[–] Kissaki@programming.dev 2 points 2 days ago (1 children)

Hard links may work too unless you want a "primary" view/reference store and a "different view on that".

[–] e0qdk@reddthat.com 4 points 2 days ago

I've tried setting up projects that used hard links like that and there are some pros and cons to this. On the plus side, you can delete from one location and the file is still available in the other without having to manage a separate repository structure. On the down side, most software cannot copy the structure correctly to a different file system (even one that supports hard links), which can make backups and migrations annoying to deal with -- generally you end up with multiple actual copies, ballooning disk space usage and sometimes causing weird issues if the two files linking to the same data (rather than just having copies of the same data) actually matters...

I'd recommend sticking with the "primary repository of real files" and "multiple views filled with symlinks" structure over hardlinks unless you're really sure you know what you're getting yourself into.

[–] just_another_person@lemmy.world 1 points 2 days ago* (last edited 2 days ago)

Really need more clarification. Are you saying you want your ls to show things differently based on the current directory?

ZSH+oh-my-zsh or similar to take pwd into account and switch profiles will do this. It's not going to be fast, but it will do what you want.