On a Unix/Linux system I need to run the "find" command on a set of directories to find what all the symbolic links within those directories are. I need to get a list of the symbolic link paths in one file AND a list of the output of "ls -l" on those symbolic links in another file. How can I do this?
preguntado el 27 de agosto de 11 a las 23:08
Change to the directory in question, then:
$ find -type l > /tmp/link_names.txt $ (for link in $(cat /tmp/output.txt); do ls -l "$link"; done) > /tmp/link_details.txt
advertencia: if any of the paths contain spaces you'll have to use something like this to get the "ls -l" output:
$ find -type l | -print0 | xargs -0 ls -l > /tmp/link_details.txt