'cat'에 해당되는 글 2건

  1. 2009/07/31 리눅스에서 디스크 그대로 복사
  2. 2004/04/14 man cat

# cat /dev/sda > /dev/sdb





- dd 로 하나씩 밀어넣으면 에러까지 똑같이 복사된다고 한다.
- /dev/sdb는 파티셔닝, 파일시스템 작업없이 공장출하 상태의 디스크라도 상관없다.
- 가급적 같은 모델, 같은 용량을 추천, 다른건 안해봤음

man cat

컴퓨터/System 2004/04/14 07:17

CAT

Section: User Commands (1)
Updated: 7 October 2002
Index
Return to Main Contents

NAME

cat - concatenate and write files

파일을 연결하거나 쓴다.


SYNOPSIS

cat [-benstuvABET] [--binary] [--number] [--number-nonblank] [--show-all] [--show-ends] [--show-nonprinting] [--show-tabs] [--squeeze-blank] [FILE...]

cat [--help] [--version]

DESCRIPTION

cat writes each FILE to standard output. If FILE is omitted or if is a `-', standard input is used.

요약

cat는 표준출력으로 내보낸다.

만약 파일명이 생략되었거나 - 이면 표준입력을 받는다.

OPTIONS

-b, --number-nonblank
Number all nonblank output lines, starting with 1.
출력에서 공백이 아닌 모든 문장에 숫자가 붙는다. 1부터 시작

-e
Equivalent to `-vE'.
-vE 옵션과 같음 

-n, --number
Number all output lines, starting with 1.
모든 출력라인에 숫자를 붙인다. 1부터 시작

-s, --squeeze-blank
Replace multiple adjacent blank lines with a single blank line.
인접한 여러공백라인을 하나의 공백라인으로 대체

-t
Equivalent to `-vT'.
-vT 옵션과 같음

-u
Ignored; for Unix compatibility.
유닉스 호완용

-v, --show-nonprinting
Display control characters except for <LFD> and <TAB> using `^' notation and precede characters that have the high bit set with `M-'.
LFD, TAB, ^으로 시작하는 표기문자를 제외한 제어문자를 출력한다.          
-A, --show-all
Equivalent to `-vET'.
-vET 옵션과 같음 

-B, --binary
On DOS platforms only, read and write files in binary mode. See notes below for details on binary and text modes.
도스플랫폼에서만 사용가능.바이너리모드에서 파일을 읽거나 쓸 수 있다.
바이너리,텍스트모드에 대해서는 아래 참조

-E, --show-ends
Display a `$' after the end of each line.
각 라인의 끝에 $ 문자를 추가시켜 출력

-T, --show-tabs
Display <TAB> characters as `^I'.
탭문자를 ^I 로 표시한다(꺽쇠와 대문자 I)

--help
Print a usage message on standard output and exit successfully.
--version
Print version information on standard output then exit successfully.

DOS TEXT/BINARY MODE

cat uses text mode by default, and binary mode when standard output is redirected to a file or pipe. This behaviour can be changed by specifying --binary-fR or --show-nonprinting to use binary mode, or --number-blank, --show-ends and --number to use text mode.

Text mode involves character translation (for example <CR> to <CR><LF>), and therefore is unsuitable for cat-copying files because it doesn't preserve the original contents.

cat는 기본적으로 텍스트모드로 운영된다.

또한, 표준출력이 파일이나 파이프로 redirect 될때는 바이너리 모드로도 운영된다.

이는 바이너리모드로 사용가능하게 하는옵션(--binary-fR 또는 --show-nonprinting),

텍스트모드로 사용가능하게 하는 옵션(--number-blank 또는 --show-ends 또는 --number)으로써 상호변환이 가능하게 한다.

텍스트모드는 translation을 포함한다. 그러므로 원본파일을 보존할 수없기 때문에 cat로 복사하는건 적합하지 않다.

NOTES

Report bugs to bug-textutils@gnu.org.
Man page by Ragnar Hojland Espinosa < ragnar@ragnar-hojland.com>
TAG cat, man