Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

For recursive links, how do I restrict the number of symbolic links to follow?

0
Posted

For recursive links, how do I restrict the number of symbolic links to follow?

0

Use the “-l link-depth” option. The link-depth argument is either a numeric value (number of symblic links to follow) or the keyword “unlimited”. Note: Normally it is not necessary to restrict the number of symbolic links. Some simple programs follow each symbolic link. If a symbolic link points back to a parent, grandparent… directory these programs go into an infinite loop. The kls program doesn’t. When traversing directories recursively it keeps track of the parent, grandparent… directories already visited by device number and inode number. Before opening a new directory, device and inode number are checked and compared against all parent, grandparent… directories already in the search path. Only those directories not yet visited are opened for inspection.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.