diff options
author | EuAndreh <eu@euandre.org> | 2024-11-18 08:21:58 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-11-18 08:44:57 -0300 |
commit | 960e4410f76801356ebd42801c914b2910a302a7 (patch) | |
tree | 615d379416f72956d0c1666c63ce062859041fbe /src/content/tils/2020/11/08 | |
parent | Remove jekyll infrastructure setup (diff) | |
download | euandre.org-960e4410f76801356ebd42801c914b2910a302a7.tar.gz euandre.org-960e4410f76801356ebd42801c914b2910a302a7.tar.xz |
Diffstat (limited to 'src/content/tils/2020/11/08')
-rw-r--r-- | src/content/tils/2020/11/08/find-broken-symlink.adoc | 36 |
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/ |