Talk:Cat (Unix)

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Free Software / Software / Computing  (Rated Start-class, Mid-importance)
WikiProject icon This article is within the scope of WikiProject Free Software, a collaborative effort to improve the coverage of free software on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
Start-Class article Start  This article has been rated as Start-Class on the project's quality scale.
 Mid  This article has been rated as Mid-importance on the project's importance scale.
Taskforce icon
This article is supported by WikiProject Software (marked as Mid-importance).
Taskforce icon
This article is supported by WikiProject Computing (marked as Mid-importance).

copy commands[edit]

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.

00:30, 17 October 2007 (UTC)


I think that most people likely to use Linux or UNIX by the terminal understand the implications of a command being able to seek in a file. This implies that the command is able to go back and forth through the file, and possibly read from it multiple times, which could allow optimization. — Preceding unsigned comment added by (talk) 17:12, 17 June 2016 (UTC)

UTF-8 BOM handling[edit]

It is not clear if cat command can concatenates texts files starting with UTF-8 Byte order Mark (BOM). Does such an option exist? Or is cat not suitable for text file processing? — Preceding unsigned comment added by (talk) 10:48, 30 June 2012 (UTC)