<?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 options in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654065#M240918</link>
    <description>Hi shiva,&lt;BR /&gt;&lt;BR /&gt;cp -i will do the work. As man page says,&lt;BR /&gt;&lt;BR /&gt;     -i      (interactive copy) Cause cp to write a prompt to standard error and wait for a response before copying a file that would overwrite an existing file.  If the response from the standard input is affirmative, the file is copied if permissions allow the copy.  If the -i (interactive) and -f (forced-copy)options are both specified, the -i option is ignored.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Syam</description>
    <pubDate>Thu, 20 Oct 2005 12:26:38 GMT</pubDate>
    <dc:creator>Ranjith_5</dc:creator>
    <dc:date>2005-10-20T12:26:38Z</dc:date>
    <item>
      <title>cp command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654059#M240912</link>
      <description>Dear Sirs,&lt;BR /&gt;&lt;BR /&gt;What is the option to use while using cp command so that any existing files with the same names are not overwritten ?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shiv</description>
      <pubDate>Thu, 20 Oct 2005 12:13:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654059#M240912</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2005-10-20T12:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: cp command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654060#M240913</link>
      <description>Hi,&lt;BR /&gt; &lt;BR /&gt;If I recall correctly, "cp -i" will ask you to confirm any replacement.&lt;BR /&gt; &lt;BR /&gt;Regards,&lt;BR /&gt;Zigor</description>
      <pubDate>Thu, 20 Oct 2005 12:19:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654060#M240913</guid>
      <dc:creator>Zigor Buruaga</dc:creator>
      <dc:date>2005-10-20T12:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: cp command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654061#M240914</link>
      <description>cp -i</description>
      <pubDate>Thu, 20 Oct 2005 12:20:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654061#M240914</guid>
      <dc:creator>Slawomir Gora</dc:creator>
      <dc:date>2005-10-20T12:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: cp command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654062#M240915</link>
      <description>I don't recall an option that automatically skips overwriting files, but you can do a -i for interactive mode, which will prompt you to overwrite or not.</description>
      <pubDate>Thu, 20 Oct 2005 12:20:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654062#M240915</guid>
      <dc:creator>Pat Lieberg</dc:creator>
      <dc:date>2005-10-20T12:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: cp command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654063#M240916</link>
      <description>Have a look at the man page.  That gives information on all options available.&lt;BR /&gt;&lt;BR /&gt;# man cp</description>
      <pubDate>Thu, 20 Oct 2005 12:22:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654063#M240916</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2005-10-20T12:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: cp command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654064#M240917</link>
      <description>May be you should protect the target file from being overwritten (file permissions).&lt;BR /&gt;&lt;BR /&gt;I don't know any option with the cp command that would do what you want.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Thu, 20 Oct 2005 12:23:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654064#M240917</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2005-10-20T12:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: cp command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654065#M240918</link>
      <description>Hi shiva,&lt;BR /&gt;&lt;BR /&gt;cp -i will do the work. As man page says,&lt;BR /&gt;&lt;BR /&gt;     -i      (interactive copy) Cause cp to write a prompt to standard error and wait for a response before copying a file that would overwrite an existing file.  If the response from the standard input is affirmative, the file is copied if permissions allow the copy.  If the -i (interactive) and -f (forced-copy)options are both specified, the -i option is ignored.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Syam</description>
      <pubDate>Thu, 20 Oct 2005 12:26:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654065#M240918</guid>
      <dc:creator>Ranjith_5</dc:creator>
      <dc:date>2005-10-20T12:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: cp command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654066#M240919</link>
      <description>cp -i will be in interactive mode but if you many (lots of them) to copy, you could be sitting there answering the question for each file for quite some time.&lt;BR /&gt;&lt;BR /&gt;cp itself does not have a protection like you seek.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Protect the files that previously exist. Example: cp the originals off somewhere, do your copy. then cp the originals back.&lt;BR /&gt;&lt;BR /&gt;If you do the cp as root, changing the perms will not protect the originals.</description>
      <pubDate>Thu, 20 Oct 2005 12:34:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654066#M240919</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-10-20T12:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: cp command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654067#M240920</link>
      <description>Thinking of another possibility, 'cpio' will preserve older files unless to specify the option to overwrite. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 20 Oct 2005 12:36:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654067#M240920</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-10-20T12:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: cp command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654068#M240921</link>
      <description>What would be the syntax of "cpio" to use ?&lt;BR /&gt;&lt;BR /&gt;sorry, i am not an expert in unix sys admin world and hence lots of silly questions.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shiv</description>
      <pubDate>Thu, 20 Oct 2005 12:49:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654068#M240921</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2005-10-20T12:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: cp command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654069#M240922</link>
      <description>Hi Shiva,&lt;BR /&gt;&lt;BR /&gt;Lets go through an example.&lt;BR /&gt;&lt;BR /&gt;Move (copying) /usr &lt;BR /&gt;Copy a directory from one location to another. Even if it has "special" files and links in it: &lt;BR /&gt;cd /usr&lt;BR /&gt;find . -print | cpio -dlmpuvx /usr2&lt;BR /&gt;  d = Do directories&lt;BR /&gt;  l = Do links&lt;BR /&gt;  m = Keep time&lt;BR /&gt;  p = Pass along&lt;BR /&gt;  u = Copy unconditionaly&lt;BR /&gt;  v = verbose&lt;BR /&gt;  x = Save device special files&lt;BR /&gt;&lt;BR /&gt;for copying data from one disk to another disk.&lt;BR /&gt;&lt;BR /&gt;find . -depth -print | cpio -odmv &amp;gt; newdisk&lt;BR /&gt;&lt;BR /&gt;see complete command ref.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/B2355-60105/cpio.1.html" target="_blank"&gt;http://docs.hp.com/en/B2355-60105/cpio.1.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Syam</description>
      <pubDate>Thu, 20 Oct 2005 12:54:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654069#M240922</guid>
      <dc:creator>Ranjith_5</dc:creator>
      <dc:date>2005-10-20T12:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: cp command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654070#M240923</link>
      <description>EXAMPLES&lt;BR /&gt;===============&lt;BR /&gt;Copy the contents of a directory into a tape archive: &lt;BR /&gt;&lt;BR /&gt;ls | cpio -o &amp;gt; /dev/rmt/c0t0d0BEST &lt;BR /&gt;&lt;BR /&gt;Duplicate a directory hierarchy: &lt;BR /&gt;&lt;BR /&gt;cd olddir &lt;BR /&gt;find . -depth -print | cpio -pd newdir&lt;BR /&gt;&lt;BR /&gt;The trivial case &lt;BR /&gt;&lt;BR /&gt;find . -depth -print | cpio -oB &amp;gt;/dev/rmt/c0t0d0BEST&lt;BR /&gt;&lt;BR /&gt;can be handled more efficiently by: &lt;BR /&gt;&lt;BR /&gt;find . -cpio /dev/rmt/c0t0d0BEST &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Syam&lt;BR /&gt;</description>
      <pubDate>Thu, 20 Oct 2005 12:57:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654070#M240923</guid>
      <dc:creator>Ranjith_5</dc:creator>
      <dc:date>2005-10-20T12:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: cp command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654071#M240924</link>
      <description>Many people will define an alias in /etc/profile or ~/.profile so that the cp command always runs with -i. For example, in your .profile put the line:&lt;BR /&gt;&lt;BR /&gt;cp='/usr/bin/cp -i'&lt;BR /&gt;&lt;BR /&gt;Also, a good idea for rm and mv commands:&lt;BR /&gt;&lt;BR /&gt;rm='/usr/bin/rm -i'&lt;BR /&gt;mv='/usr/bin/mv -i'&lt;BR /&gt;&lt;BR /&gt;Also, again in .profile, you can prevent shell output redirection from overwriting existing files.&lt;BR /&gt;&lt;BR /&gt;for posix and korn shells:&lt;BR /&gt;&lt;BR /&gt;set -o noclobber&lt;BR /&gt;&lt;BR /&gt;see the man pages for additional explanation.&lt;BR /&gt;&lt;BR /&gt; - John</description>
      <pubDate>Thu, 20 Oct 2005 13:05:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654071#M240924</guid>
      <dc:creator>John Kittel</dc:creator>
      <dc:date>2005-10-20T13:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: cp command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654072#M240925</link>
      <description>cp -i&lt;BR /&gt;the best should be to define an alias:&lt;BR /&gt;alias cp='cp -i'.&lt;BR /&gt;It this way any time you try to cp a file if teh detsination file is not empty teh command asks for your confirmation.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Art</description>
      <pubDate>Fri, 21 Oct 2005 03:36:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654072#M240925</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2005-10-21T03:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: cp command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654073#M240926</link>
      <description>Run the following command before you start your copy:&lt;BR /&gt;&lt;BR /&gt;set noclobber&lt;BR /&gt;&lt;BR /&gt;This prevents files from being overwritten.&lt;BR /&gt;&lt;BR /&gt;Mark Syder (like the drink but spelt different)</description>
      <pubDate>Fri, 21 Oct 2005 03:48:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-options/m-p/3654073#M240926</guid>
      <dc:creator>MarkSyder</dc:creator>
      <dc:date>2005-10-21T03:48:31Z</dc:date>
    </item>
  </channel>
</rss>

