반응형
1) name 옵션
ex) host로 끝나는 모든 파일 검색
#-name 옵션
[node2 ~]$ find / -xdev -name "host*" -exec ls -lad {} \;
-rw-r--r-- 1 root root 9 Jun 7 2013 /etc/host.conf
-rw-r--r-- 1 root root 169 Dec 16 14:04 /etc/hosts
-rw-r--r-- 1 root root 370 Jun 7 2013 /etc/hosts.allow
-rw-r--r-- 1 root root 460 Jun 7 2013 /etc/hosts.deny
drwx------ 2 root root 44 Dec 27 2020 /etc/selinux/targeted/active/modules/100/hostname
-rw-r--r-- 1 root root 6 Dec 16 14:04 /etc/hostname
-rwxr-xr-x 1 root root 3274160 Sep 9 2020 /opt/cni/bin/host-device
-rwxr-xr-x 1 root root 2847152 Sep 9 2020 /opt/cni/bin/host-local
-rwxr-xr-x 1 root root 28984 Aug 20 2019 /usr/bin/hostid
-rwxr-xr-x 1 root root 15784 Oct 18 2019 /usr/bin/hostname
-rwxr-xr-x 1 root root 325704 Oct 1 2020 /usr/bin/hostnamectl
-rw-r--r-- 1 root root 2213 Oct 1 2020 /usr/share/bash-completion/completions/hostnamectl
-rw-r--r-- 1 root root 4017 Oct 1 2020 /usr/share/perl5/Net/hostent.pm
2) size option
-size +1000000c ---> 'c' for bytes
- size +100000M ---> for mebibytes MiB
-size +1G ----> 'G' for gibibytes GiB
[node2 ~]$ find / -xdev -size +10000000c -exec ls -l {} \;
-rwxr-xr-x 1 root root 10861704 Dec 27 2020 /usr/bin/docker-compose
-rwxr-xr-x 1 root root 57099280 Dec 2 2020 /usr/bin/containerd
-rwxr-xr-x 1 root root 22021168 Jul 9 2019 /usr/bin/crictl
-rwxr-xr-x 1 root root 30440976 Dec 2 2020 /usr/bin/ctr
-rwxr-xr-x 1 root root 71620680 Dec 15 2020 /usr/bin/docker
-rwxr-xr-x 1 root root 116277624 Dec 15 2020 /usr/bin/dockerd
-rwxr-xr-x 1 root root 39219040 Dec 18 2020 /usr/bin/kubeadm
-rwxr-xr-x 1 root root 40228064 Dec 18 2020 /usr/bin/kubectl
-rwxr-xr-x 1 root root 113982176 Dec 18 2020 /usr/bin/kubelet
-rwxr-xr-x 1 root root 15784696 Dec 15 2020 /usr/bin/rootlesskit
-rwxr-xr-x 1 root root 18274176 Dec 2 2020 /usr/bin/runc
-rwxr-xr-x 1 root root 37118728 Dec 15 2020 /usr/libexec/docker/cli-plugins/docker-app
-rwxr-xr-x 1 root root 54454752 Dec 15 2020 /usr/libexec/docker/cli-plugins/docker-buildx
-rw-r--r-- 1 root root 19070976 Dec 27 2020 /var/lib/rpm/Packages
3) -exec 사용법
-exec 옵션으로 추가 명령어 사용시 "{} \;" argument는 꼭 필요.
argument 없을시 아래와 같은 에러 발생함.
"find: missing argument to `-exec'"
ㅁ exec 없음
[node2 ~]$ find / -xdev -name "*hostname*"
/etc/dbus-1/system.d/org.freedesktop.hostname1.conf
/etc/selinux/targeted/active/modules/100/hostname
/etc/hostname
/usr/bin/hostname
ㅁ exec 에러 ( add "-exec <command> {} \;" )
[node2 ~]$ find / -xdev -name "*hostname*" -exec ls -l
find: missing argument to `-exec'
--> 조치( "-exec <command> {} \;")
[node2 ~]$ find / -xdev -name "*hostname*" -exec ls -l {} \;
-rw------- 1 root root 2246 Dec 27 2020 cil
-rw------- 1 root root 10176 Dec 27 2020 hll
반응형
'OS > LINUX' 카테고리의 다른 글
[nfs] server not responding (0) | 2023.01.21 |
---|---|
I/O Error 확인 (0) | 2022.12.21 |
/etc/group- , /etc/passwd- 파일생성 (0) | 2018.08.07 |
gvfs (0) | 2018.01.17 |
firewall-cmd --remove 명령 오류 해결 (0) | 2017.12.29 |