I managed to find a command to get a list of broken links, but not "working" symbolic links
find -H mydir -type l
How can I do the opposite?
If I have these files in mydir:
mydir
foo bar bob carol
If these are all symbolic links, but bobpoint to a file that does not exist, I want to see
bob
foo bar carol
C find(1)use
find(1)
$ find . -type l -not -xtype l
, - . ( , , . -xtype f -not -xtype l, , .)
-xtype f
-not -xtype l
$ find . -type l -not -xtype l -ls
, .
, zsh :
% echo **/*(@^-@)
: glob @ , ^-@ " not (^)) (@), (-).
@
^-@
^
-
(. python, , Linux. . , .)
(LINUX) , , :
find DIR1 -type l -xtype f -ls
"find" (LINUX) xtype: " -xtype , -type "
:
find DIR1 -type l -xtype d -ls
bash:
find . -type l -print | while read src do [[ -e "$src" ]] && echo $src done
, , →