• Source
    1. #
    2. #Write a script to display the name of those files (in the given directory) which are having multiple links.
    3. #
    4. clear
    5. echo -n "Enter name of the directory :"
    6. read directory
    7. if [ ! -d "$directory" ]
    8. then
    9. echo "Directory does not exist"
    10. else
    11. count=0
    12. for i in $(find $directory -type f ! -links 1)
    13. do
    14. echo $i
    15. count=$(echo $count + 1 | bc -l)
    16. done
    17. if [ $count -eq 0 ]
    18. then
    19. echo "No files found with multiple links"
    20. fi
    21. fi
    22.