<?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: cp command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command/m-p/3976727#M293801</link>
    <description>Well a single file I haven't got it to do, but I can get it to copy everything under a directory (files and sub-directories) and create those directories:&lt;BR /&gt;&lt;BR /&gt;cp -r /root/testdir1/* /root/testdir2/&lt;BR /&gt;&lt;BR /&gt;Where /testdir2 did NOT exist...&lt;BR /&gt;it copies everything over including sub-dir .. /root/testdir2/testdir3/testfile3&lt;BR /&gt;&lt;BR /&gt;But a single file...maybe somebody else can get that one..&lt;BR /&gt;&lt;BR /&gt;Rgrds,&lt;BR /&gt;Rita</description>
    <pubDate>Fri, 06 Apr 2007 12:15:32 GMT</pubDate>
    <dc:creator>Rita C Workman</dc:creator>
    <dc:date>2007-04-06T12:15:32Z</dc:date>
    <item>
      <title>cp command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command/m-p/3976726#M293800</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Is there a way to use the cp command to copy a file with absolute path to another directory that would create the paths for you?  For example:&lt;BR /&gt;I have this file /u01/scripts/sql/test.sql and would like to copy test.sql to /u02.  Since I don't have scripts/sql directory created under /u02, the cp -r command won't create it for me.  It simply put /u01/scripts/sql/test.sql to /u02/test.sql.  In Linux I can use the switch --parents and that creates the directory structure for me.  Any help is appreciated.&lt;BR /&gt;&lt;BR /&gt;thanks,</description>
      <pubDate>Fri, 06 Apr 2007 11:47:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command/m-p/3976726#M293800</guid>
      <dc:creator>Tom Dau</dc:creator>
      <dc:date>2007-04-06T11:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: cp command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command/m-p/3976727#M293801</link>
      <description>Well a single file I haven't got it to do, but I can get it to copy everything under a directory (files and sub-directories) and create those directories:&lt;BR /&gt;&lt;BR /&gt;cp -r /root/testdir1/* /root/testdir2/&lt;BR /&gt;&lt;BR /&gt;Where /testdir2 did NOT exist...&lt;BR /&gt;it copies everything over including sub-dir .. /root/testdir2/testdir3/testfile3&lt;BR /&gt;&lt;BR /&gt;But a single file...maybe somebody else can get that one..&lt;BR /&gt;&lt;BR /&gt;Rgrds,&lt;BR /&gt;Rita</description>
      <pubDate>Fri, 06 Apr 2007 12:15:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command/m-p/3976727#M293801</guid>
      <dc:creator>Rita C Workman</dc:creator>
      <dc:date>2007-04-06T12:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: cp command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command/m-p/3976728#M293802</link>
      <description>Not directly. You can test to see if a directory exists and then issue a mkdir -p /aaa/bbb/ccc/ddd command which will create any missiing directories in the path.</description>
      <pubDate>Fri, 06 Apr 2007 12:19:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command/m-p/3976728#M293802</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-04-06T12:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: cp command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command/m-p/3976729#M293803</link>
      <description>Thank you all.  I guess I have to live with that.  The reason is if I have many many files with different directory structures, then I have to script it somehow to make it work especially those files come from the find command.&lt;BR /&gt;&lt;BR /&gt;Thanks again.&lt;BR /&gt;&lt;BR /&gt;TD</description>
      <pubDate>Fri, 06 Apr 2007 12:25:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command/m-p/3976729#M293803</guid>
      <dc:creator>Tom Dau</dc:creator>
      <dc:date>2007-04-06T12:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: cp command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command/m-p/3976730#M293804</link>
      <description>have you tried:&lt;BR /&gt;cd /u01&lt;BR /&gt;find . -depth | cpio -dumpv /&lt;DESTINATION&gt;&lt;BR /&gt;&lt;BR /&gt;or the tar version:&lt;BR /&gt;cd /u01&lt;BR /&gt;tar cf - .|(cd /u02; tar xf -)&lt;/DESTINATION&gt;</description>
      <pubDate>Fri, 06 Apr 2007 13:58:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command/m-p/3976730#M293804</guid>
      <dc:creator>Jannik</dc:creator>
      <dc:date>2007-04-06T13:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: cp command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command/m-p/3976731#M293805</link>
      <description>Instead of using cp, you can use tar or pax to "copy" the file.  This will create any needed directories.  pax(1) allows renaming.</description>
      <pubDate>Fri, 06 Apr 2007 20:21:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command/m-p/3976731#M293805</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-04-06T20:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: cp command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command/m-p/3976732#M293806</link>
      <description>Hi Tom,&lt;BR /&gt;&lt;BR /&gt; You can try with the -R option with cp. but this will copy the entire directory to the new locaion.&lt;BR /&gt;&lt;BR /&gt; The command would be &lt;BR /&gt;&lt;BR /&gt; cp -prR u01/scripts /u02&lt;BR /&gt;&lt;BR /&gt;This will create the directories u02/scripts/sql/test.sql and copy the entire contents of the directory scripts to the new location. &lt;BR /&gt;Please ignore if you have already tried this option.</description>
      <pubDate>Tue, 10 Apr 2007 04:15:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command/m-p/3976732#M293806</guid>
      <dc:creator>Hareesh Kumar</dc:creator>
      <dc:date>2007-04-10T04:15:32Z</dc:date>
    </item>
  </channel>
</rss>

