cleanlinks - remove dangling symlinks and empty directories


cleanlinks [ PATH ] [ options ]


Enforces the absence of dangling symbolic links; i.e., symbolic links pointing to targets which no longer exist.

The cleanlinks program searches the directory tree descended from the current directory or the directory rooted at the PATH given as an optional argument, for dangling symlinks, and removes them. Use the --directory option to remove symlinks that point to directories. Finally, it removes all empty directories in that directory tree.


-d, --directory: remove symlinks to directories

-h, --help: display usage guide

-V, --version: display version and copyright information

-m, --manual: output manual text


A message will be printed upon encountering each dangling symlink, directory symlink or empty directory. Cyclic symlinks emit the warning Too many levels of symbolic links and require removal manually.


Written by David Dawes. Rewritten by Erik Southworth.




Copyright (c) Erik Southworth, 2009,2010 This is free software: see the source for copying conditions. You are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. This is free documentation: copying and distribution of this manual, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.


stow(1) xstow(1) cp(1)


Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.