summaryrefslogtreecommitdiff
path: root/src/content/en/tils/2020/11/08/find-broken-symlink.adoc
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-04-18 02:17:12 -0300
committerEuAndreh <eu@euandre.org>2025-04-18 02:48:42 -0300
commit020c1e77489b772f854bb3288b9c8d2818a6bf9d (patch)
tree142aec725a52162a446ea7d947cb4347c9d573c9 /src/content/en/tils/2020/11/08/find-broken-symlink.adoc
parentMakefile: Remove security.txt.gz (diff)
downloadeuandre.org-020c1e77489b772f854bb3288b9c8d2818a6bf9d.tar.gz
euandre.org-020c1e77489b772f854bb3288b9c8d2818a6bf9d.tar.xz
git mv src/content/* src/content/en/
Diffstat (limited to 'src/content/en/tils/2020/11/08/find-broken-symlink.adoc')
-rw-r--r--src/content/en/tils/2020/11/08/find-broken-symlink.adoc25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/content/en/tils/2020/11/08/find-broken-symlink.adoc b/src/content/en/tils/2020/11/08/find-broken-symlink.adoc
new file mode 100644
index 0000000..624d24a
--- /dev/null
+++ b/src/content/en/tils/2020/11/08/find-broken-symlink.adoc
@@ -0,0 +1,25 @@
+= Find broken symlinks with "find"
+:categories: shell
+
+:annex: https://git-annex.branchable.com/
+:annex-wanted: https://git-annex.branchable.com/git-annex-wanted/
+
+The `find` command knows how to show broken symlinks:
+
+[source,sh]
+----
+find . -xtype l
+----
+
+This was useful to me when combined with {annex}[Git Annex]. Its
+{annex-wanted}[`wanted`] option allows you to have a "sparse" checkout of the
+content, and save space by not having to copy every annexed file locally:
+
+[source,sh]
+----
+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.