Cat: 두 판 사이의 차이
둘러보기로 이동
검색으로 이동
imported>Tinywolf (새 문서: === cat === 사용자 명령. 터미널 명령. == 이름 및 목적 == con'''cat'''enate files and print on the standard output. 파일의 내용을 연결하고 표준출력(std...) |
imported>Tinywolf (→사용예) |
||
| 24번째 줄: | 24번째 줄: | ||
4. 긴 내용을 페이지로 넘기며 보기 | 4. 긴 내용을 페이지로 넘기며 보기 | ||
$ cat a.txt b.txt | more | $ cat a.txt b.txt | more | ||
5. 파일 내용 정렬하기 | |||
$ cat a.txt b.txt | sort | $ cat a.txt b.txt | sort | ||
6. 파일 내용 정렬해서 저장하기 | 6. 파일 내용 정렬해서 저장하기 | ||
2014년 8월 26일 (화) 03:19 판
cat
사용자 명령. 터미널 명령.
이름 및 목적
concatenate files and print on the standard output.
파일의 내용을 연결하고 표준출력(stdout, 현재 터미널)에 출력한다.
용법
cat [옵션] [파일]...
사용예
1. 파일 화면에 출력
$ cat a.txt
2. 여러 개의 파일 연속 출력
$ cat a.txt b.txt c.txt
3. 파일 모아서 저장하기
$ cat a.txt b.txt c.txt > r.txt
4. 긴 내용을 페이지로 넘기며 보기
$ cat a.txt b.txt | more
5. 파일 내용 정렬하기
$ cat a.txt b.txt | sort
6. 파일 내용 정렬해서 저장하기
$ cat a.txt b.txt | sort > r.txt
7. 키보드로 치는 내용 출력하기 (종료는 Ctrl+D.)
$ cat
8. 키보드로 치는 내용 저장하기 (종료는 Ctrl+D.)
$ cat > i.txt
자주 사용되는 옵션
- 출력되는 모든 라인에 줄번호 달기
-n, --number $ cat -n a.txt b.txt
전체 옵션
(터미널 명령의 대부분은 옵션은 "--"으로 시작하는 풀네임과 "-"으로 시작하는 단축 문자가 있습니다.)
- equivalent to -vET
-A, --show-all
- number nonblank output lines
-b, --number-nonblank
- equivalent to -vE
-e
- display $ at end of each line
-E, --show-ends
- number all output lines
-n, --number
- never more than one single blank line
-s, --squeeze-blank
- equivalent to -vT
-t
- display TAB characters as ^I
-T, --show-tabs
- use ^ and M- notation, except for LFD and TAB
-v, --show-nonprinting
- display this help and exit
--help
- output version information and exit
--version
참고
<references/>