0

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

6
  • 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 PL
    Commented Nov 23, 2022 at 23:02
  • 1
    Please 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! Commented Nov 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? Commented Nov 23, 2022 at 23:11
  • Example: file.txt -> softlink1 softlink2. My teacher says it's possible
    – Asker PL
    Commented Nov 23, 2022 at 23:14
  • Could you confirm or deny my understanding, please? Commented Nov 23, 2022 at 23:15

1 Answer 1

1

Like this:

cd /usr/bin
find . -type l -exec bash -c '
    v=$(readlink "$1")
    [[ -L "$v" ]] && echo "$1"
' -- {} \;
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .