diff options
author | EuAndreh <eu@euandre.org> | 2020-11-08 08:40:25 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2020-11-08 08:43:58 -0300 |
commit | d041cdec079f1f656558fb415c133a2020880565 (patch) | |
tree | cf78ce58e1f0b39c812dd21ca61f59aca9774281 /_tils | |
parent | local-first slides: Update link to article and add extra reference (diff) | |
download | euandre.org-d041cdec079f1f656558fb415c133a2020880565.tar.gz euandre.org-d041cdec079f1f656558fb415c133a2020880565.tar.xz |
Add find -xtype l TIL entry
Diffstat (limited to '')
-rw-r--r-- | _tils/2020-11-08-find-broken-symlinks-with-find.md | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/_tils/2020-11-08-find-broken-symlinks-with-find.md b/_tils/2020-11-08-find-broken-symlinks-with-find.md new file mode 100644 index 0000000..7912df0 --- /dev/null +++ b/_tils/2020-11-08-find-broken-symlinks-with-find.md @@ -0,0 +1,34 @@ +--- + +title: Find broken symlinks with "find" + +date: 2020-11-08 + +layout: post + +lang: en + +ref: find-broken-symlinks-with-find + +--- + +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/ |