Necesita ayuda para enumerar enlaces simbólicos

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

1 Respuestas

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

Respondido 28 ago 11, 03:08

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.