LNDIR(1)

πŸ’– LNDIR(1) β€” shadow-directory slay πŸ’…

okay so welcome to the General Commands Manual page for lndir β€” yes, the LNDIR(1) one, bestie. it’s the tool that makes a whole shadow tree where the β€œfiles” are actually symlinks, and it’s literally giving mirror-world realness πŸͺžβœ¨

🌸 NAME 🌸

lndir β€” create a shadow directory of symbolic links to another directory tree. πŸ”—πŸ«Ά

✨ SYNOPSIS ✨

lndir [ -silent ] [ -ignorelinks ] [ -withrevinfo ] fromdir [ todir ]

πŸ¦‹ DESCRIPTION πŸ¦‹

so lndir makes todir a shadow copy of the directory tree fromdir β€” except the shadow isn’t populated with real files. instead it’s populated with symbolic links pointing at the real files in the fromdir directory tree. slay. this is usually useful for maintaining source code for different machine architectures: you create a shadow directory containing links to the real source, which you’ll usually have mounted from a remote machine. then you can build in the shadow tree, and the object files will be in the shadow directory, while the source files in the shadow directory are just symlinks to the real files. πŸ’…

the advantage of this scheme? if you update the source, you need not propagate the change to the other architectures by hand, since all source in all shadow directories are symlinks to the real thing: just cd to the shadow directory and recompile away. πŸŽ€

the todir argument is optional and defaults to the current directory. the fromdir argument may be relative (e.g., ../src) and is relative to todir (not the current directory). lowkey important, bestie. πŸ‘€

note: BitKeeper, CVS, CVS.adm, .git, .hg, RCS, SCCS, and .svn directories are shadowed only if the -withrevinfo flag is specified. files with names ending in ~ are never shadowed. 🚫

if you add files, simply run lndir again. new files will be silently added. old files will be checked that they have the correct link. ✨

deleting files is a more painful problem; the symlinks will just point into never never land. πŸ˜­πŸ’€

if a file in fromdir is a symbolic link, lndir will make the same link in todir rather than making a link back to the (symbolic link) entry in fromdir. the -ignorelinks flag changes this behavior. πŸͺž

πŸ’… OPTIONS πŸ’…

  • -silent β€” normally lndir outputs the name of each subdirectory as it descends into it. this option suppresses those status messages. quiet queen behavior. 🀫
  • -ignorelinks β€” causes the program to not treat symbolic links in fromdir specially. the link created in todir will point back to the corresponding (symbolic link) file in fromdir. if the link is to a directory, this is almost certainly the wrong thing. this option exists mostly to emulate the behavior the C version of lndir had in X11R6. its use is not recommended. πŸ™ˆ
  • -withrevinfo β€” causes any source control manager subdirectories (those named BitKeeper, CVS, CVS.adm, .git, .hg, RCS, SCCS, or .svn) to be treated as any other directory, rather than ignored. πŸ‘‘

πŸ” DIAGNOSTICS πŸ”

the program displays the name of each subdirectory it enters, followed by a colon. the -silent option suppresses these messages. πŸ—£οΈ

a warning message is displayed if the symbolic link cannot be created. the usual problem is that a regular file of the same name already exists. ⚠️

if the link already exists but doesn’t point to the correct file, the program prints the link name and the location where it does point. πŸ•΅οΈβ€β™€οΈ

🌈 SEE ALSO 🌈

ln(1). go give it a lil read, bestie. πŸ”—


final sign-off vibes: X Version 11 and lndir 1.0.5 on the LNDIR(1) page 🫢✨ the footer didn’t give a date, so we’re not making one up β€” periodt. πŸ’–

πŸ“¦ where this page comes from