<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Dead soft links in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427859#M1973</link>
    <description>Paul got it.  -a specifies "file exists" with no test for other traits (readable, directory, character special, etc.) is posix and ksh.  Do a man ksh to see the full range of flags.&lt;BR /&gt;</description>
    <pubDate>Wed, 28 Jun 2000 15:22:11 GMT</pubDate>
    <dc:creator>Alan Riggs</dc:creator>
    <dc:date>2000-06-28T15:22:11Z</dc:date>
    <item>
      <title>Dead soft links</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427851#M1965</link>
      <description>I have a number of directorries with rather a big number of soft links in them.  What would be the command to find out which soft links are dead?  I tried man on ln but nothing usefull came up.&lt;BR /&gt;&lt;BR /&gt;I don't want to do it pen and paper way because it would defeat the purpose of having the computer.  If a script has to be written, I can do it to as long as I know what I'm looking for... Thanks.</description>
      <pubDate>Tue, 27 Jun 2000 15:49:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427851#M1965</guid>
      <dc:creator>Bolek Mynarski</dc:creator>
      <dc:date>2000-06-27T15:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dead soft links</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427852#M1966</link>
      <description>No specific command available that I know of.&lt;BR /&gt;&lt;BR /&gt;If you want to write a script, here are some thing to watch for:&lt;BR /&gt;&lt;BR /&gt;Links can be associated with their target in one of three ways.  It can point to an absolute path, a relative path (does not have to be in same directory, you see ../../&lt;TARGET&gt; a lot in some unix implementations), or a direct reference to another file or directory in the same directory where the link exists.&lt;BR /&gt;&lt;BR /&gt;A find command will locate all links on a system with the -type l search criteria.&lt;BR /&gt;&lt;BR /&gt;There are some situations where the link may point to something that is only valid when an NFS mount is active.  &lt;BR /&gt;&lt;BR /&gt;Be sure to test your script VERY carefully prior to removing any links!  Run the output to a file you review first!  And don't rely on the script test operators for regular files and directories alone!  If the link points to something like a block device, the test would fail and you could end up removing a valid link that is otherwise allowing the machine to run!  &lt;BR /&gt;&lt;BR /&gt;There is a good chance that someone out there has already written a script to do what you are looking for.  In cases like these I usually will look around the open source community for something that fits the bill.  A good source for stuff like this is &lt;A href="http://www.oase-shareware.org/shell/links" target="_blank"&gt;http://www.oase-shareware.org/shell/links&lt;/A&gt; (shelldorado).&lt;BR /&gt;&lt;BR /&gt;My best advice is to just leave them alone for now.  The amount of disk space and inode usage is usually not worth talking about.  I know some may suggest this goes against the motherhood of keeping a clean system.  But I guess a clean system is not much use if its dead.&lt;/TARGET&gt;</description>
      <pubDate>Tue, 27 Jun 2000 17:38:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427852#M1966</guid>
      <dc:creator>Tim Malnati</dc:creator>
      <dc:date>2000-06-27T17:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Dead soft links</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427853#M1967</link>
      <description>From what I understand of your question, you want to find out which files are soft linked to non-existant files?&lt;BR /&gt;&lt;BR /&gt;A rather slow way of searching for all files with symbolic links would be using the ncheck command to check for the inode of a file.  The ncheck is a very slow command though.  You can restrict it to just one mounted file system though.&lt;BR /&gt;&lt;BR /&gt;You can get the inode number for a file with the ls -li command, then run;&lt;BR /&gt;&lt;BR /&gt;  ncheck [/dev/vg00/lvol1] | grep the_inode_number</description>
      <pubDate>Tue, 27 Jun 2000 17:48:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427853#M1967</guid>
      <dc:creator>Dale McNamara</dc:creator>
      <dc:date>2000-06-27T17:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Dead soft links</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427854#M1968</link>
      <description>ll | grep '-&amp;gt;'|awk '{print $9" "$11}'| while read LINK FILE&lt;BR /&gt;do&lt;BR /&gt;    if [ ! -a $FILE ]&lt;BR /&gt;    then&lt;BR /&gt;        echo $LINK is a dead link&lt;BR /&gt;    fi&lt;BR /&gt;done</description>
      <pubDate>Tue, 27 Jun 2000 18:55:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427854#M1968</guid>
      <dc:creator>Alan Riggs</dc:creator>
      <dc:date>2000-06-27T18:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dead soft links</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427855#M1969</link>
      <description>Thanks everybody for a reply.  Since I posted that message, I wrote a shell script myself that would search for that links (I was in the crunch and lucky for me, I was dealing on ly with files in specific directories which I knew were soft links to other files.  To be more specific, they were links to database files).  Again, I did not have to remove anything but only to print a list of links going nowhere.  I have accomplished that task so that's done.&lt;BR /&gt;&lt;BR /&gt;Another happy customer was out there.. :-)&lt;BR /&gt;&lt;BR /&gt;Thanks again.</description>
      <pubDate>Tue, 27 Jun 2000 19:01:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427855#M1969</guid>
      <dc:creator>Bolek Mynarski</dc:creator>
      <dc:date>2000-06-27T19:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dead soft links</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427856#M1970</link>
      <description>To Alan Riggs (or anybody who knows the answer)&lt;BR /&gt;&lt;BR /&gt;O.K.  I can only imagine what "-a" test stands for.  I was looking for it in my books and documentation but could not find anything that would confirm what I think it.&lt;BR /&gt;&lt;BR /&gt;So, what "-a" stands for in this particular context??&lt;BR /&gt;&lt;BR /&gt;if [ ! -a $FILE ]&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Wed, 28 Jun 2000 12:01:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427856#M1970</guid>
      <dc:creator>Bolek Mynarski</dc:creator>
      <dc:date>2000-06-28T12:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dead soft links</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427857#M1971</link>
      <description>If you are using the posix shell or ksh, then test (and [ ) are built-ins with more power than is shown on the man page for test.  The man page for ksh says that &lt;BR /&gt;  -a file   true if file exists</description>
      <pubDate>Wed, 28 Jun 2000 12:23:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427857#M1971</guid>
      <dc:creator>Paul Hite</dc:creator>
      <dc:date>2000-06-28T12:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dead soft links</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427858#M1972</link>
      <description>Hmm, it's all different then, from what I know for checking if the file exists:&lt;BR /&gt;&lt;BR /&gt;-e or -f. I gues, I have to commit to my memory one more test paramter... :-)</description>
      <pubDate>Wed, 28 Jun 2000 15:12:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427858#M1972</guid>
      <dc:creator>Bolek Mynarski</dc:creator>
      <dc:date>2000-06-28T15:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dead soft links</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427859#M1973</link>
      <description>Paul got it.  -a specifies "file exists" with no test for other traits (readable, directory, character special, etc.) is posix and ksh.  Do a man ksh to see the full range of flags.&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Jun 2000 15:22:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427859#M1973</guid>
      <dc:creator>Alan Riggs</dc:creator>
      <dc:date>2000-06-28T15:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dead soft links</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427860#M1974</link>
      <description>Try someting like this.  &lt;BR /&gt;find ./ -type l -exec file {} ;&lt;BR /&gt;&lt;BR /&gt;the file command will fail on any non-existant link files and should get you started.  The list of errors could then be used for arguments into rm .&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 07 Jul 2000 13:17:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dead-soft-links/m-p/2427860#M1974</guid>
      <dc:creator>Tim Nelson</dc:creator>
      <dc:date>2000-07-07T13:17:14Z</dc:date>
    </item>
  </channel>
</rss>

