aboutsummaryrefslogtreecommitdiff
path: root/src/content/tils/2020/11/08/find-broken-symlink.adoc
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-11-18 08:21:58 -0300
committerEuAndreh <eu@euandre.org>2024-11-18 08:44:57 -0300
commit960e4410f76801356ebd42801c914b2910a302a7 (patch)
tree615d379416f72956d0c1666c63ce062859041fbe /src/content/tils/2020/11/08/find-broken-symlink.adoc
parentRemove jekyll infrastructure setup (diff)
downloadeuandre.org-960e4410f76801356ebd42801c914b2910a302a7.tar.gz
euandre.org-960e4410f76801356ebd42801c914b2910a302a7.tar.xz
v0 migration to mkwbHEADmain
Diffstat (limited to 'src/content/tils/2020/11/08/find-broken-symlink.adoc')
-rw-r--r--src/content/tils/2020/11/08/find-broken-symlink.adoc36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/content/tils/2020/11/08/find-broken-symlink.adoc b/src/content/tils/2020/11/08/find-broken-symlink.adoc
new file mode 100644
index 0000000..bc97fc6
--- /dev/null
+++ b/src/content/tils/2020/11/08/find-broken-symlink.adoc
@@ -0,0 +1,36 @@
+---
+
+title: Find broken symlinks with "find"
+
+date: 2020-11-08
+
+layout: post
+
+lang: en
+
+ref: find-broken-symlinks-with-find
+
+eu_categories: shell
+
+---
+
+The `find` command knows how to show broken symlinks:
+
+```shell
+find . -xtype l
+```
+
+This was useful to me when combined with [Git Annex][git-annex]. Its
+[`wanted`][git-annex-wanted] option allows you to have a "sparse" checkout of
+the content, and save space by not having to copy every annexed file locally:
+
+```shell
+git annex wanted . 'exclude=Music/* and exclude=Videos/*'
+```
+
+You can `find` any broken symlinks outside those directories by querying with
+Git Annex itself, but `find . -xtype l` works on other places too, where broken
+symlinks might be a problem.
+
+[git-annex]: https://git-annex.branchable.com/
+[git-annex-wanted]: https://git-annex.branchable.com/git-annex-wanted/