I want to find symlinks that contain only multiple soft links. I know how to list all files containing soft links but I want to show only files that contain multiple soft links
-
I mean file like fol.txt that contain two soft links (I think you are from Poland we can speak polish it will be easier)– Asker PLNov 23, 2022 at 23:02
-
1Please don't speak Polish on here - I'd like to understand as well, and I don't think your English is the problem - it's actually very good!– Marcus MüllerNov 23, 2022 at 23:10
-
I think the problem is the you confuse file with file name. You mean a text file containing multiple names of files that are actually soft links (symbolic links), right?– Marcus MüllerNov 23, 2022 at 23:11
-
Example: file.txt -> softlink1 softlink2. My teacher says it's possible– Asker PLNov 23, 2022 at 23:14
-
Could you confirm or deny my understanding, please?– Marcus MüllerNov 23, 2022 at 23:15
1 Answer
Like this:
cd /usr/bin
find . -type l -exec bash -c '
v=$(readlink "$1")
[[ -L "$v" ]] && echo "$1"
' -- {} \;