Since writing this page years ago, Iβve become a bit better at using the Terminal.1 I just realised how simple it is to move to a Johnny.Decimal folder. Hereβs how.
Iβll explain why this works, as youβll need to tweak it for your own setup. So the first thing you need to know is where my system lives on my filesystem. My personal system, folder name P76 Johnny's personal system, is in my ~/Documents folder.
To make the examples here simpler Iβll assume weβve already cd ~/Documents.
Wildcards
Two quick things to know.
A wildcard * means βany textβ. So instead of P76 Johnny's personal system I can just write P76*. This works uniquely well in Johnny.Decimal because the majority of your folders staβ¦
Since writing this page years ago, Iβve become a bit better at using the Terminal.1 I just realised how simple it is to move to a Johnny.Decimal folder. Hereβs how.
Iβll explain why this works, as youβll need to tweak it for your own setup. So the first thing you need to know is where my system lives on my filesystem. My personal system, folder name P76 Johnny's personal system, is in my ~/Documents folder.
To make the examples here simpler Iβll assume weβve already cd ~/Documents.
Wildcards
Two quick things to know.
A wildcard * means βany textβ. So instead of P76 Johnny's personal system I can just write P76*. This works uniquely well in Johnny.Decimal because the majority of your folders start with a unique number.
You can expand this by using the amazingly-named globstar pattern. Within a path, ** will match any folder. Itβs like a really-wildcard.
Globs
Seriously, this pattern is called a glob. You werenβt allowed to have those when I was at school.
If I want to navigate to my ID 15.53, this is what I do.
cd P76*/**/15.53*
Thatβs it! Weβre saying please change directory to the folder that starts P76, of which there is only one. Then, search all of its subfolders **, until you find one that starts 15.53. Thereβs only one of those.
Open the folder in Finder
If you want to actually open a Finder window, vs. staying in the Terminal:
open P76*/**/15.53*
Amaaaaazing.
Advanced script
Howβs this update to the cdj script, from Murrax on Discord.
cdj() {
# Update with your document root folder
pushd ~/Documents/JD/*/*/${1}*/*(#i)($2)**([1])
}
export cdj
Iβll quote Murrax for the details:
it lets you go into subfolders too, searching by substring, e.g. cdj 31.14 COMSM0067 puts me in ~/Documents/31 Formal Education/31.14 University of Bristol/+COMSM0067 Advanced Topics in Programming Languages, or if I forget the unit code I can do cdj 31.14 languages
A-maaaa-zing.
100% human. 0% AI. Always.
Footnotes
That cdj() script came from someone else, I didnβt write it. If you did, let me know! Authorship is lost to the sands of time. β©
β
β β/βΆ βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
β’
β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β