리눅스 / 명령어 / cat / 파일 내용 출력하는 명령어

리눅스의 cat(concatenate의 약자) 명령어는 파일의 내용을 화면에 출력하거나 파일을 결합하는 데 사용됩니다. cat 명령어는 주로 텍스트 파일을 다룰 때 유용하며, 여러 개의 파일을 한 번에 읽거나 결합할 수 있습니다.

다음과 같은 두 개의 파일이 있다고 할 때

file1

1-1
1-2
1-3

file2

2-1
2-2
2-3

cat filename

  • cat 뒤에 파일 이름을 넣으면 파일 안의 내용을 보여줍니다.
# cat file1
1-1
1-2
1-3
  • 파일 이름을 연달아 넣으면 연속하여 파일의 내용을 보여줍니다.
# cat file1 file2
1-1
1-2
1-3
2-1
2-2
2-3

cat filename -n

  • -n 옵션을 붙이면 줄번호를 보여줍니다.
# cat -n file1
1 1-1
2 1-2
3 1-3
# cat -n file1 file2
1 1-1
2 1-2
3 1-3
4 2-1
5 2-2
6 2-3

cat filename filename > filename

  • cat 뒤에 파일 이름들을 쓰고, > 뒤에 새로운 파일이름을 쓰면, 파일들의 내용들을 합하여 새로운 파일을 만듭니다.
# cat file1 file2 > file3
# cat file3
1-1
1-2
1-3
2-1
2-2
2-3
같은 카테고리의 다른 글
팟플레이어 / 영상 캡처, 영상 회전, 영상 반전

팟플레이어 / 영상 캡처, 영상 회전, 영상 반전

영상 캡처 마우스 우클릭 후 에서 캡처를 할 수 있다. 복사, 바로 캡처, 캡처가 있는데... 복사 : 클립보드에 복사한다. 이미지 편집 프로그램 등에서 붙여넣으면 된다. 바로 캡처 : 캡처한 이미지를 캡처 폴더에 바로 저장한다. 캡처 : 저장할 위치와 파일 이름을 정할 수 있다. 캡처 폴더는 에서 정할 수 있다. 원본 크기와 ...

리눅스 / 명령어 / which, whereis, locate / 명령어 위치 찾기

명령어의 위치를 찾을 때 사용할 수 있는 명령어에는 which, whereis, locate가 있다. 명령어의 위치만 찾을 때는 which를 사용하고, 관련된 파일들의 위치까지 찾을 때는 whereis나 locate를 사용한다. which 명령어로 find 명령어를 찾는다. # which find /usr/bin/find whereis 명령어로 find 명령어를 찾는다. # whereis find find: /usr/bin/find /usr/share/man/man1/find.1.gz locate 명령어로 find 명령어를 찾는다. # locate find /usr/bin/find /usr/bin/find2perl /usr/bin/findmnt /usr/bin/nl-link-ifindex2name /usr/bin/nl-link-name2ifindex /usr/bin/oldfind /usr/lib64/python2.7/modulefinder.py /usr/lib64/python2.7/modulefinder.pyc /usr/lib64/python2.7/modulefinder.pyo /usr/sbin/btrfs-find-root /usr/sbin/findfs /usr/share/bash-completion/completions/findmnt /usr/share/doc/findutils-4.5.11 /usr/share/doc/findutils-4.5.11/AUTHORS /usr/share/doc/findutils-4.5.11/COPYING /usr/share/doc/findutils-4.5.11/ChangeLog /usr/share/doc/findutils-4.5.11/NEWS /usr/share/doc/findutils-4.5.11/README /usr/share/doc/findutils-4.5.11/THANKS /usr/share/doc/findutils-4.5.11/TODO /usr/share/doc/wpa_supplicant-2.6/examples/p2p/p2p_find.py /usr/share/doc/wpa_supplicant-2.6/examples/p2p/p2p_stop_find.py /usr/share/info/find-maint.info.gz /usr/share/info/find.info.gz /usr/share/locale/be/LC_MESSAGES/findutils.mo /usr/share/locale/bg/LC_MESSAGES/findutils.mo /usr/share/locale/ca/LC_MESSAGES/findutils.mo /usr/share/locale/cs/LC_MESSAGES/findutils.mo /usr/share/locale/da/LC_MESSAGES/findutils.mo /usr/share/locale/de/LC_MESSAGES/findutils.mo /usr/share/locale/el/LC_MESSAGES/findutils.mo /usr/share/locale/eo/LC_MESSAGES/findutils.mo /usr/share/locale/es/LC_MESSAGES/findutils.mo /usr/share/locale/et/LC_MESSAGES/findutils.mo /usr/share/locale/fi/LC_MESSAGES/findutils.mo /usr/share/locale/fr/LC_MESSAGES/findutils.mo /usr/share/locale/ga/LC_MESSAGES/findutils.mo /usr/share/locale/gl/LC_MESSAGES/findutils.mo /usr/share/locale/hr/LC_MESSAGES/findutils.mo /usr/share/locale/hu/LC_MESSAGES/findutils.mo /usr/share/locale/id/LC_MESSAGES/findutils.mo /usr/share/locale/it/LC_MESSAGES/findutils.mo /usr/share/locale/ja/LC_MESSAGES/findutils.mo /usr/share/locale/ko/LC_MESSAGES/findutils.mo /usr/share/locale/lg/LC_MESSAGES/findutils.mo /usr/share/locale/lt/LC_MESSAGES/findutils.mo /usr/share/locale/ms/LC_MESSAGES/findutils.mo /usr/share/locale/nl/LC_MESSAGES/findutils.mo /usr/share/locale/pl/LC_MESSAGES/findutils.mo /usr/share/locale/pt/LC_MESSAGES/findutils.mo /usr/share/locale/pt_BR/LC_MESSAGES/findutils.mo /usr/share/locale/ro/LC_MESSAGES/findutils.mo /usr/share/locale/ru/LC_MESSAGES/findutils.mo /usr/share/locale/rw/LC_MESSAGES/findutils.mo /usr/share/locale/sk/LC_MESSAGES/findutils.mo /usr/share/locale/sl/LC_MESSAGES/findutils.mo /usr/share/locale/sr/LC_MESSAGES/findutils.mo /usr/share/locale/sv/LC_MESSAGES/findutils.mo /usr/share/locale/tr/LC_MESSAGES/findutils.mo /usr/share/locale/uk/LC_MESSAGES/findutils.mo /usr/share/locale/vi/LC_MESSAGES/findutils.mo /usr/share/locale/zh_CN/LC_MESSAGES/findutils.mo /usr/share/locale/zh_TW/LC_MESSAGES/findutils.mo /usr/share/man/man1/find.1.gz /usr/share/man/man1/find2perl.1.gz /usr/share/man/man1/oldfind.1.gz /usr/share/man/man8/btrfs-find-root.8.gz /usr/share/man/man8/findfs.8.gz /usr/share/man/man8/findmnt.8.gz locate 명령어는 -n 옵션으로 출력 ...

스토리지 / DAS / 특징, 장점

스토리지 / DAS / 특징, 장점

직접 연결 스토리지(DAS, Direct Attached Storage)는 컴퓨터나 서버에 직접 연결되어 데이터를 저장하는 스토리지 장치입니다. DAS는 일반적으로 하나의 서버에 물리적으로 연결되며, 별도의 네트워크를 통해 다른 장치와 공유되지 않습니다. DAS의 주요 특징 직접 연결 DAS는 서버나 컴퓨터에 직접 연결되는 형태로, 일반적으로 SCSI(Small Computer System Interface), SAS(Serial Attached SCSI), SATA(Serial ATA) 등의 인터페이스를 통해 연결됩니다. 이는 ...

엣지 / 코파일럿 아이콘 없애는 방법

엣지 / 코파일럿 아이콘 없애는 방법

엣지 브라우저 오른쪽 위에 코파일럿 아이콘이 있습니다. 아이콘을 클릭하면 사이드바가 열리면서 코파일럿과 채팅을 할 수 있죠. 만약 코파일럿을 사용하지 않아서 이 기능이 전혀 필요하지 않다면, 코파일럿 아이콘을 안 보이게 할 수 있습니다.

CPU / 내장 그래픽(Integrated Graphics)

CPU 내장 그래픽(Integrated Graphics)은 별도의 그래픽 카드 없이 CPU 자체에 그래픽 처리 기능을 통합한 기술입니다. 이 기술은 주로 인텔과 AMD에서 제공하는 다양한 CPU 모델에서 찾아볼 수 있습니다. 내장 그래픽은 주로 일반적인 컴퓨팅 작업과 가벼운 게임, 미디어 소비 등에 사용되며, 고성능 그래픽 카드가 필요 없는 사용자에게 비용 효율적인 솔루션을 제공합니다. 이 ...

ThinkBook 16p G2 ACH / 메모

ThinkBook 16p G2 ACH / 메모

구입 이유 ThinkBook 16p 20YM0002KR를 구입했다. 뒷면에는 ThinkBook 16p G2 ACH라고 써 있더라. 이걸 산 이유는.... 해상도가 WQXGA(2560x1600). FHD(1920x1080)는 불편하다. 글자가 작아도 QHD 이상이 좋다. X-Rite Pantone 공장 캘리브레이션. 색을 잘 표현해준다고 한다. 디자인 작업을 하는 나에게는 중요한 것. NVIDIA 외장 그래픽 카드. 자주 하지는 않지만 동영상 편집 등을 할 때 필요하다. 물론 게임도... 메모리 ...

크롬 / 주소 표시줄 검색 엔진 변경하는 방법

크롬 / 주소 표시줄 검색 엔진 변경하는 방법

크롬 웹브라우저의 주소 표시줄에 검색어를 입력하고 엔터키를 누르면 지정된 검색 엔진으로 검색하고 결과를 보여준다. 크롬의 기본 검색 엔진은 당연히 구글이다. 만약 주소 표시줄 검색 엔진을 변경하고 싶다면... 오른쪽 위의 점 세 개 아이콘을 클릭한다. 을 클릭한다. 왼쪽 메뉴에서 을 클릭한다. 주소 표시줄에서 사용되는 검색 엔진을 원하는 것으로 선택한다.

모니터 / 해상도

모니터 해상도는 화면에 표시되는 픽셀의 수를 의미하며, 가로 픽셀 수와 세로 픽셀 수로 표현됩니다. 예를 들어, 1920x1080 해상도는 가로 방향에 1920개의 픽셀, 세로 방향에 1080개의 픽셀이 있다는 뜻입니다. 해상도는 화면의 선명도와 세부 표현에 직접적인 영향을 미칩니다. 주요 해상도 종류 HD (High Definition) 해상도: 1280x720 (720p) 특징: 기본적인 HD 해상도로, 저가형 모니터와 TV에서 사용됩니다. 일반적인 ...

Ubuntu 18.04 Server / PHP 최신 버전으로 업그레이드하는 방법

Ubuntu 패키지로 설치한 PHP 버전보다 PHP 최신 버전이 더 높을 수 있습니다. 예를 들어 패키지로 설치한 PHP의 버전은 7.0, 최신 버전은 7.2일 수 있다는 것이죠. 만약 최신 버전의 PHP를 사용해야 한다면 다음의 방법으로 설치할 수 있습니다. PHP를 처음 설치하는 경우 저장소를 추가합니다. # add-apt-repository ppa:ondrej/php 패키지 정보를 업데이트합니다. # apt-get update PHP를 설치합니다. # apt-get install php PHP가 ...

DSLR / 렌즈의 초점 거리와 화각 그리고 효과

DSLR / 렌즈의 초점 거리와 화각 그리고 효과

렌즈의 특성은 여러 가지가 있어요. 렌즈 이름에 그 특성이 표현되어 있죠. 그 중에서 초점 거리에 대해서 알아봤어요. 예를 들어 EF-S 18-55mm F4-5.6 IS STM 라고 하면 18-55mm가 초점 거리에요. 렌즈마다 초점 거리가 다른데, 초점 거리가 변하면 무엇이 달라지는지 정리해보겠습니다. 초점 거리 우선 초점 거리가 무엇인지 알아야겠죠? 그런데 이게 좀 어려워요. 자료마다 용어, 표현, 의미가 ...