문서의 이전 판입니다!
파일 검색
Find Command
기본 명령어 형식은 find [찾을 디렉토리] [찾기 옵션] [찾은 후 실행할 작업]
확장자 명으로 검색
전체 하드 디스크에서 검색
명령어 : find / -name '*.확장자'
[root@localhost ~]# find / -name '*.c' /usr/lib/firmware/isci/create_fw.c /usr/share/doc/systemd/sd-readahead.c /usr/share/doc/ppp-2.4.5/scripts/chatchat/chatchat.c
현재 경로에서 디스크 검색
명령어 : find -name '*.확장자'
[root@localhost ~]# find -name '*.c' ./sample.c
검색 시 해당 파일이 없는 상태에서는 문구조차 나오지 않는다.
[root@localhost ~]# find -name '*.c
[root@localhost ~]#
파일 명으로 검색
전체 하드디스크에서 검색
명령어 : find / -name '파일명'
[root@localhost ~]# find / -name 'sample' /usr/share/doc/ppp-2.4.5/sample
전체 하드디스크에서 모든 확장자 포함 검색
명령어 : find / -name '파일명.*'
[root@localhost ~]# find / -name 'sample.*' /root/sample.txt /root/sample.c /usr/share/doc/sudo-1.8.6p7/sample.pam /usr/share/doc/sudo-1.8.6p7/sample.sudo.conf /usr/share/doc/sudo-1.8.6p7/sample.sudoers /usr/share/doc/sudo-1.8.6p7/sample.syslog.conf /data/sample.txt
전체 하드디스크에서 일부 검색어로 검색
명령어 : find / -name '파일명*'
[root@localhost ~]# find / -name 'sample*' /root/sample.txt /root/sample.c /usr/share/doc/ppp-2.4.5/sample /usr/share/doc/redhat-support-tool-0.9.6/samples /usr/share/doc/sudo-1.8.6p7/sample.pam /usr/share/doc/sudo-1.8.6p7/sample.sudo.conf /usr/share/doc/sudo-1.8.6p7/sample.sudoers /usr/share/doc/sudo-1.8.6p7/sample.syslog.conf /data/sample.txt
유저 명으로 검색
Grep Command
로그인하면 댓글을 남길 수 있습니다.