<?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: Simple script to delete files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-script-to-delete-files/m-p/2667682#M722983</link>
    <description>To do this in a script:&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;find / -name 'Makefile.lcl' &amp;gt; /tmp/make.list&lt;BR /&gt;for i in `cat /tmp/make.list`&lt;BR /&gt;  do&lt;BR /&gt;    rm $i&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;The find should work faster, but for loops will always be your friend.&lt;BR /&gt;&lt;BR /&gt;GL,&lt;BR /&gt;C</description>
    <pubDate>Tue, 19 Feb 2002 20:20:25 GMT</pubDate>
    <dc:creator>Craig Rants</dc:creator>
    <dc:date>2002-02-19T20:20:25Z</dc:date>
    <item>
      <title>Simple script to delete files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-script-to-delete-files/m-p/2667678#M722979</link>
      <description>Hi all you script guru's:&lt;BR /&gt;&lt;BR /&gt;I need a script to go thur &lt;BR /&gt;all the files to find &lt;BR /&gt;Makefile.lcl and delete that file (but not delete Makefile).&lt;BR /&gt;&lt;BR /&gt;I did a:&lt;BR /&gt;&lt;BR /&gt;find / -name Makefile.lcl&lt;BR /&gt;&lt;BR /&gt;and got 7 pages and I was&lt;BR /&gt;deleting them one a time and&lt;BR /&gt;I said hey a script could do &lt;BR /&gt;this.&lt;BR /&gt;&lt;BR /&gt;I know it's very simple but&lt;BR /&gt;I can't afford to delete anything else (unemployment&lt;BR /&gt;seems scarey in today's&lt;BR /&gt;economy).&lt;BR /&gt;&lt;BR /&gt;Could someone send me a&lt;BR /&gt;simple and safe delete script?&lt;BR /&gt;I'm using HP-UX 11.0 csh but&lt;BR /&gt;I'm open to any shell type.&lt;BR /&gt;&lt;BR /&gt;TIA,&lt;BR /&gt;Laurie</description>
      <pubDate>Tue, 19 Feb 2002 19:58:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-script-to-delete-files/m-p/2667678#M722979</guid>
      <dc:creator>Laurie_2</dc:creator>
      <dc:date>2002-02-19T19:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: Simple script to delete files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-script-to-delete-files/m-p/2667679#M722980</link>
      <description>How about this:&lt;BR /&gt;&lt;BR /&gt;find / -name 'Makefile.lcl' -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;I really prefer not to do a find from / but rather to cd to the desired directory and do a find . instead. Before you do the -exec rm {} \; I suggest that you find do a harmless command like -exec echo {} \; first.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Feb 2002 20:07:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-script-to-delete-files/m-p/2667679#M722980</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-02-19T20:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Simple script to delete files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-script-to-delete-files/m-p/2667680#M722981</link>
      <description>laurie,&lt;BR /&gt;&lt;BR /&gt;just extend your "find"&lt;BR /&gt;&lt;BR /&gt;find / -name "Makefile\.lcl" -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;Note the quotes and "escaped" period to get an exact file match.&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 19 Feb 2002 20:08:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-script-to-delete-files/m-p/2667680#M722981</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-02-19T20:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Simple script to delete files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-script-to-delete-files/m-p/2667681#M722982</link>
      <description>If you have a lot of these files, then a more efficient form of find is to pipe the file names to "xargs" to remove multiple files in fewer forked processes.&lt;BR /&gt;&lt;BR /&gt;find / -name Makefile.lcl -print | xargs rm -f&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 19 Feb 2002 20:19:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-script-to-delete-files/m-p/2667681#M722982</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-02-19T20:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: Simple script to delete files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-script-to-delete-files/m-p/2667682#M722983</link>
      <description>To do this in a script:&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;find / -name 'Makefile.lcl' &amp;gt; /tmp/make.list&lt;BR /&gt;for i in `cat /tmp/make.list`&lt;BR /&gt;  do&lt;BR /&gt;    rm $i&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;The find should work faster, but for loops will always be your friend.&lt;BR /&gt;&lt;BR /&gt;GL,&lt;BR /&gt;C</description>
      <pubDate>Tue, 19 Feb 2002 20:20:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-script-to-delete-files/m-p/2667682#M722983</guid>
      <dc:creator>Craig Rants</dc:creator>
      <dc:date>2002-02-19T20:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Simple script to delete files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-script-to-delete-files/m-p/2667683#M722984</link>
      <description>find from / is a performance killer.  Use du -a instead if you care about system load:&lt;BR /&gt;&lt;BR /&gt;du -a |awk '$2 ~ "Makefile.lcl$" {print $2}|xargs rm&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Feb 2002 20:29:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-script-to-delete-files/m-p/2667683#M722984</guid>
      <dc:creator>Alan Riggs</dc:creator>
      <dc:date>2002-02-19T20:29:40Z</dc:date>
    </item>
  </channel>
</rss>

