Im trying to make a script that lists all symbolic link files in a directory but the command im using doesnt seem to work in the script but works when i use it in the terminal.
You can try these options and see what fits to your need best.
Pseudo code:
#!/usr/bin/bash
find . -type l -ls
#To only process the current directory:
#find . -maxdepth 1 -type l -ls
More find commands to list symbolic link in dir:
find -L /dir/to/start -xtype l -samefile ~/Pictures 2>/dev/null.
find / -lname /path/to/original/dir
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.