"Link Pane" Note - Bash Script

Thought this might be useful to some of the geekier users.

This is a bash one-liner (run from macOS Terminal in my case) that:
Creates a new note called “ΩΩ Link Cloud.md” listing all wikilinks used in vault, sorted by number of times used (see image).

Useful for seeing your most linked notes and also to ‘Quality Check’ to make sure all your links are good.

++ Here’s a 16 second video demo ++

Note:

  • The script needs to be run from within the folder you want to process.
  • I’m running it on macOS, and I don’t know if it will work on PC.
  • You could set it up to run periodically using some sort of automation systems (Keyboard Maestro in my case, but many options out there)

The Script (run it from within the directory you want to process):

egrep -ohsr --exclude-dir='.*' "\[\[[A-Za-z0-9 [email protected]ÄÖÜäöüß\'\!\?\.\(\)\-]+\]\]" -- * | sed -e 's/[[:space:]]#/#/' | sort | uniq -c | sort -r -t# -k2  > "ΩΩ Link Cloud.md"
12 Likes

Works well. Very useful. Do you have a KM macro? If so, could you share it too?

1 Like

Worked also very well under Ubuntu. I did have to remove the spaces at the beginning of line 1 in order to get the links to work but it was enough to do the first line and all the lines work then too.

Thanks for sharing!

1 Like

Yeah absolutely! So glad it works.

Dropbox download link

Just update the first line with the path to your vault location.

Note: I’ve set it to be ‘triggered’ when the Obsidian app deactivates (so when I click to another app). For me this is a nice clever way to have it update when I’m working in Obsidian (and click away as I frequently do), but it could also be set to run every 5 minutes or something if you prefer.

1 Like

Oh interesting! Always curious to see the tiny variations from system to system.

1 Like

Many thanks for sharing, it works well !

Further to my comment of yesterday, which I still maintain (:smiley:), I wonder if there is a possibility to include markdown links too.

Markdown links as per filename

awesome tool, added to the toolbox, thank you!

1 Like

I have seen this used in several places since you created this. Thanks so much for your work putting this together. I would like to get this to work, but I am not sure how to go about the process. My vault is on iCloud drive/taio.

Any help would be greatly appreciated,
Thx.

非常好的脚本