<?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: moving files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/3267723#M178100</link>
    <description>Does this command works individualy for you:&lt;BR /&gt;mv ./bla/dir1/subdir1/*.html ./bla/dir1/&lt;BR /&gt;&lt;BR /&gt;and Also What you are expecting exactly!! whether you want to move that same in one single command&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 05 May 2004 03:39:13 GMT</pubDate>
    <dc:creator>Bharat Katkar</dc:creator>
    <dc:date>2004-05-05T03:39:13Z</dc:date>
    <item>
      <title>moving files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/3267722#M178099</link>
      <description>I want to move all html-files for a given subtree one directory up.&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;mv ./bla/dir1/subdir1/*.html ./bla/dir1/&lt;BR /&gt;mv ./bla/dir2/subdir2/*.html ./bla/dir2/&lt;BR /&gt;mv ./bla/dir2/subdir2/1/*.html ./bla/dir2/subdir2/&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;I have tried the following:&lt;BR /&gt;&lt;BR /&gt;find . -name *.html|xargs -i -p mv {} ../{}&lt;BR /&gt;(-p for interactivity)&lt;BR /&gt;&lt;BR /&gt;which does not work (of course). The output is:&lt;BR /&gt;mv ./bla/dir1/subdir1/doc1.html .././bla/dir1/subdir1/*.html ?...&lt;BR /&gt;&lt;BR /&gt;Not beeing familiar with awk or sed I'd like to know how to replace the string before the last slash to "..".&lt;BR /&gt;&lt;BR /&gt;Or is there a better way of doing this?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Aleks&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 05 May 2004 03:02:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/3267722#M178099</guid>
      <dc:creator>Aleksandar Vujevic</dc:creator>
      <dc:date>2004-05-05T03:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: moving files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/3267723#M178100</link>
      <description>Does this command works individualy for you:&lt;BR /&gt;mv ./bla/dir1/subdir1/*.html ./bla/dir1/&lt;BR /&gt;&lt;BR /&gt;and Also What you are expecting exactly!! whether you want to move that same in one single command&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 05 May 2004 03:39:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/3267723#M178100</guid>
      <dc:creator>Bharat Katkar</dc:creator>
      <dc:date>2004-05-05T03:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: moving files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/3267724#M178101</link>
      <description>Hello Alexs,&lt;BR /&gt;&lt;BR /&gt;Can get xargs to work either! Anyway, test this :&lt;BR /&gt;&lt;BR /&gt;find . -name '*.html' | while read line&lt;BR /&gt;do&lt;BR /&gt;        echo mv $line `dirname $line | sed -e 's@\/[^\/]*$@@'`&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;&lt;BR /&gt;Nicolas</description>
      <pubDate>Wed, 05 May 2004 03:48:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/3267724#M178101</guid>
      <dc:creator>Nicolas Dumeige</dc:creator>
      <dc:date>2004-05-05T03:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: moving files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/3267725#M178102</link>
      <description>Aleks,&lt;BR /&gt;&lt;BR /&gt;what about&lt;BR /&gt;cd /&lt;BR /&gt;find /path/to/subdir -type d | while read dir&lt;BR /&gt;do&lt;BR /&gt;cd $dir&lt;BR /&gt;mv *.html ..&lt;BR /&gt;cd /&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Bernhard</description>
      <pubDate>Wed, 05 May 2004 04:37:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/3267725#M178102</guid>
      <dc:creator>Bernhard Mueller</dc:creator>
      <dc:date>2004-05-05T04:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: moving files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/3267726#M178103</link>
      <description>Thanks for your replies!&lt;BR /&gt;&lt;BR /&gt;With the hints from you I made the following script ($1 being the wanted files(s) ):&lt;BR /&gt;&lt;BR /&gt;CUR_DIR=`pwd`&lt;BR /&gt;# Remove . from results of find&lt;BR /&gt;FILES=`find . -name $1 | cut -c 2-`&lt;BR /&gt;&lt;BR /&gt;for file in $FILES&lt;BR /&gt;do&lt;BR /&gt; # Construct absolute path&lt;BR /&gt; file=$CUR_DIR$file&lt;BR /&gt;&lt;BR /&gt; cd `dirname $file`&lt;BR /&gt; mv `basename $file` ../&lt;BR /&gt;done&lt;BR /&gt;cd $CUR_DIR&lt;BR /&gt;&lt;BR /&gt;Aleks</description>
      <pubDate>Wed, 05 May 2004 05:01:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/3267726#M178103</guid>
      <dc:creator>Aleksandar Vujevic</dc:creator>
      <dc:date>2004-05-05T05:01:15Z</dc:date>
    </item>
  </channel>
</rss>

