Talk:Cp (Unix)

From Wikipedia, the free encyclopedia

This article is within the scope of Computing WikiProject, an attempt to build a comprehensive and detailed guide to computers and computing. If you would like to participate, you can edit the article attached to this page, or visit the project page, where you can join the project and/or contribute to the discussion.
B This article has been rated as B-Class on the quality scale
Mid This article has been rated as mid-importance on the importance scale

The section that I removed stated that Unix was file extension-agnostic, then went on to show how cp could be used to change a file extension, to "make" a .txt file into a shell script. This was contradictory, and besides, it's not really the point of cp. grendel|khan 03:54, 2004 Dec 29 (UTC)


[edit] AIX specific?

Why is this specialized for a fairly obscure and unpopular Unix? Shouldn't we change this to refer to GNU, or Linux, or a BSD at least? --maru (talk) contribs 02:32, 6 March 2006 (UTC)

AIX is neither obscure, nor unpopular. In fact, AIX, HP-UX, and Solaris have been the top three commercial Unix versions for many years. See the chart on page 3 of this survey. Linux has gained great popularity in the last 5 or 6 years. If you feel a Linux version of cp is more popular, be bold and update the article. Gbeeker 14:57, 6 March 2006 (UTC)
For a commercial Unix, it may not be obscure, but commercial Unixes certainly are. I think I will change this article to refer to GNU's cp, since that is used vastly more than AIX's. --maru (talk) contribs 17:20, 6 March 2006 (UTC)
Here is a radical thought, maybe the article should be vendor neutral. I mean are all the obscure GNU (or AIX for that matter) extensions to cp really encyclopedic anyway? --121.217.118.194 (talk) 20:52, 29 January 2008 (UTC)

[edit] copy commands

Unix/*nix programs (Also sometimes used in Windows versions)
  • cp -- copy files; can concatenate files
  • cpio -- copy an entire directory structure from one place to another
  • cat -- concatenate and display files
  • dd -- copy streams, files, or devices in whole or part
  • head -- display/copy the first part of a file
  • tail -- display/copy the last part of a file


DOS/Windows programs (Seldom used in *nix versions)
  • COPY -- copy files or sets of files, binary or text mode, can concatenate files
  • XCOPY -- eXtended version of COPY, for copying file structures
  • XXCOPY -- further extended commercial program
  • ROBOCOPY -- further extended version, included in Vista


Other specialized programs are used to split large files into pieces and then put the pieces back together.

There are no good standard programs to extract an arbitrary piece of a file into another file. dd can be used, but requires setting blocksize to 1, which is very inefficient. In Windows, the obscure program CPART can be used.

grep and awk are powerful *nix programs for looking for patterns in a file. -69.87.200.198 00:26, 17 October 2007 (UTC)