리눅스 / 명령어 / find / 파일 또는 디렉토리를 찾는 명령어

find는 파일 또는 디렉토리를 찾는 명령어이다.

  • 현재 디렉토리 안에 있는 모든 파일과 디렉토리를 출력한다. 숨긴 파일 또는 숨긴 디렉토리도 출력한다.
# find
  • /etc 디렉토리 안에 있는 모든 파일과 디렉토리를 출력한다. 숨긴 파일 또는 숨긴 디렉토리도 출력한다.
# find /etc
  • 현재 디렉토리 안에서 이름이 abc인 파일 또는 abc인 디렉토리를 검색한다.
# find -name abc
  • 현재 디렉토리 안에서 이름이 abc인 디렉토리만 검색한다.
# find -name abc -type d
  • /etc 디렉토리에서 .conf로 끝나는 파일 또는 디렉토리를 검색한다.
# find /etc *.conf
  • -empty 옵션을 붙이면 빈 파일 또는 디렉토리를 검색한다.
# find -empty
  • -exec 옵션을 붙여서 검색한 파일 또는 디렉토리에 대해서 어떤 작업을 할 수 있다. 위와 같이 하면 빈 파일 또는 디렉토리를 찾아 삭제한다.
# find -empty -exec rm -rf {} \;
같은 카테고리의 다른 글
Ubuntu 20.04 / 글꼴 설치하는 방법

Ubuntu 20.04 / 글꼴 설치하는 방법

Ubuntu 20.04 Desktop 설치하려는 글꼴을 더블 클릭하거나, 글꼴 선택 후 엔터키를 누르거나, 마우스 우클릭 후 를 클릭합니다. 상단에 있는 를 클릭합니다. 설치가 완료되면 으로 바뀝니다. 글꼴이 잘 설치되었는지 확인합니다.

리눅스 / 명령어 / 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 옵션으로 출력 ...

크롬 / 다운로드 할 때 저장 폴더 지정할 수 있게 설정하는 방법

크롬 / 다운로드 할 때 저장 폴더 지정할 수 있게 설정하는 방법

크롬 웹브라우저에서 파일을 다운로드하면 사용자 계정의 다운로드 폴더로 바로 다운로드합니다. 다운로드 폴더를 변경하거나, 다운로드할 때 저장할 위치를 지정하도록 설정할 수 있습니다. 오른쪽 위의 점 세 개 버튼을 클릭하고 을 클릭합니다.(주소 표시줄에 chrome://settings/를 입력해도 됩니다.) 왼쪽에서 를 선택하면 관련 설정을 할 수 있습니다.(주소 표시줄에 chrome://settings/downloads를 입력해도 됩니다.) 를 변경하여 기본 다운로드 폴더를 지정할 수 ...

Ubuntu 22.04 Server / Apache, PHP, MariaDB 설치하는 방법

Ubuntu 22.04 Server / Apache, PHP, MariaDB 설치하는 방법

Ubuntu Server에 웹서버 Apache, 웹프로그래밍 언어 PHP, 데이터베이스 MariaDB를 설치하는 방법입니다. 웹서버 운영을 위한 최소한의 설치로, 실제로 서비스할 때는 더 많은 패키지가 필요할 수 있습니다. 설치 Apache, PHP, MariaDB를 설치합니다. php-mysql은 PHP와 MariaDB 연동을 위한 패키지입니다. # apt install apache2 mariadb-server php php-mysql MariaDB 설정 다음과 같이 명령하여 몇 가지 설정을 합니다. # mysql_secure_installation MariaDB의 root 계정 ...

엣지 / 스크롤 캡처

엣지 / 스크롤 캡처

활성화된 창을 캡처하는 것은 쉽다. 많은 캡처 프로그램이 창 캡처를 지원한다. 그런데, 화면에 보이지 않는 곳까지 캡처할 수 있는 프로그램은 많지 않고, OS 버전이나 캡처 대상이 되는 프로그램에 따라 잘 작동하지 않는 경우가 많다. 만약 웹페이지 전체를 캡처하고 싶다면 웹브라우저에 그런 기능이 있나 살펴보자. 쉽고 빠르게 캡처할 수 있다. 마이크로소프트 엣지는 웹 ...

엣지 / 다운로드 할 때 저장 폴더 지정할 수 있게 설정하는 방법

엣지 / 다운로드 할 때 저장 폴더 지정할 수 있게 설정하는 방법

마이크로소프트 엣지 웹브라우저의 기본 설정 하에서 파일을 다운로드하면, 사용자의 다운로드 폴더로 바로 다운로드합니다. 다운로드하는 기본 폴더를 변경하거나, 다운로드할지 바로 열지 선택할 수 있게 설정을 변경할 수 있습니다. 엣지 오른쪽 위에 있는 점 세 개 아이콘을 클릭합니다. 을 클릭합니다. 왼쪽 메뉴에서 를 클릭합니다. 에서 기본 다운로드 폴더를 정할 수 있다. [각 다운로드 시 수행할 작업에 대해 ...

모니터 / 해상도

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

DSLR / 캐논 / 헝그리 망원렌즈 EF-S 55-250mm F4-5.6 IS STM 구입

DSLR / 캐논 / 헝그리 망원렌즈 EF-S 55-250mm F4-5.6 IS STM 구입

DSLR 구입할 때 딸려온 번들렌즈만 몇 년째 계속 사용했어요. 그러다 얼마전에 렌즈를 하나 구입했습니다. 처음 사는 게 힘들지 한번 사고 나면 계속 산다는데, 그말이 맞는 거 같아요. 산 지 며칠 되지도 않았는데, 단렌즈도 하나 사고 싶다는... 망원렌즈 EF-S 55-250mm F4-5.6 IS STM 구입 구입한 렌즈는 EF-S 55-250mm F4-5.6 IS STM입니다. 일명 헝그리 망원렌즈죠. 망원렌즈는 갖고 ...

안드로이드 / 앱 / 카카오톡 / 대화 내용 캡쳐하는 방법

안드로이드 / 앱 / 카카오톡 / 대화 내용 캡쳐하는 방법

스마트폰의 캡쳐 기능을 이용하면 화면을 이미지로 저장할 수 있다. 그런데 화면에 보이는 부분만 가능하다. 만약 특정 부분만 캡쳐하거나 화면을 벗어나는 부분도 캡쳐하고 싶다면 앱이 제공하는 기능을 사용한다. 카카오톡에도 캡쳐 기능이 있는데, 이를 이용하면 원하는 대화 내용을 캡쳐할 수 있고, 화면을 벗어나는 긴 대화도 캡쳐 가능하다. 대화방에서 + 아이콘을 누른다. 를 누른다. 화면이 어두워지는데... 캡쳐하려는 첫번째 ...

Visual Studio Code (VS Code) / 소개, 장점, 단점

Visual Studio Code (VS Code) / 소개, 장점, 단점

Visual Studio Code (VS Code)는 Microsoft에서 개발한 오픈 소스 코드 편집기로, 다양한 프로그래밍 언어와 플랫폼을 지원하며 개발자들 사이에서 매우 인기가 높습니다. 이 편집기는 가벼우면서도 강력한 기능을 제공하며, 개발 생산성을 높이기 위해 설계되었습니다. 아래에서 VS Code의 상세한 소개와 장단점에 대해 자세히 살펴보겠습니다. Visual Studio Code 소개 출시 및 배경 출시일 : 2015년 4월 29일에 ...