Notice
Recent Posts
Recent Comments
Link
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Archives
Today
Total
관리 메뉴

codingfarm

cat(catenate) 본문

Linux/기본명령어

cat(catenate)

scarecrow1992 2020. 10. 18. 19:52

manpages.ubuntu.com/manpages/focal/en/man1/cat.1plan9.html

  • 파일의 내용을 출력하는 명령어
  • 텍스트파일에 주로 쓰이며 바이너리파일에 쓰면 화면이 깨진체 나올것이다.
cat [option] file [other_files...]

 

옵션

-n

  • 출력시 앞에 행 번호가 붙어서 출력된다.
  • 이 행번호는 원래 파일에 없다.

 

 

파일 복사

cat orgfile > copiedfile

orgfile의 내용을 copiedfile에 그대로 덮어쓴다.

 

cat 명령어로 파일만들기

cat > filename
  • 위와 같은 명령어로 파일을 만들 수 있다.

 

 

파일 병합

cat file1 [file2...] > otherfile
  • >를 기준으로 왼쪽에 있는 파일들의 내용을 합쳐서 오른쪽에 있는 파일로 합칠 수 있다.

file1, file2, file3의 내용을 합처서 files에 덮어 씌웠음을 확인 가능

 

'Linux > 기본명령어' 카테고리의 다른 글

less  (0) 2020.10.18
more  (0) 2020.10.18
rmdir(remove directory)  (0) 2020.10.18
mkdir(make directory)  (0) 2020.10.18
ls (list)  (0) 2020.10.18
Comments