find - Linux

Linux find command common ussgae.

Quick Start

Find all file in 25-MAR-2024

1
2
3
4
5
6
$ find . -type f -newermt 2024-03-25 ! -newermt 2024-03-26  -ls
4621518 60 -rw-r--r-- 1 chengman chengman 60542 Mar 25 09:23 ./21.I.PM2-Template.v3.Change_Request_Form.ProjectName.dd-mm-yyyy.vx_.x.docx
4604245 1052 -rw-r--r-- 1 chengman chengman 1076112 Mar 25 11:17 ./Support_HW-SW_ICRIS_Dec\ 2023_draft.xlsx
4596672 76 -rw-r--r-- 1 chengman chengman 77736 Mar 25 10:53 ./QGO_NW+Svr_Serial_Number_Labeled_v1.0.xlsx
4589526 72 -rw-rw-r-- 1 chengman chengman 73707 Mar 25 11:00 ./SDC_PRD\ Rack\ Layout\ Plan\ (2023-09-12)\ (Man).xlsx

Find files with case-insensitive (-i)

1
2
3
4
5
6
$ find . -iname \*tcp*
./No Starch Press - The TCP-IP Guide - A Comprehen - 2005.pdf
./Addition-Wesley - TCPIP Illustrated, Volume 1 (The Protocols), 2e - 2012.pdf
./Sybex - TCP IP Foundations - Aug 2004.pdf
./Newnes - Practical TCP IP and Ethernet Networking - 2003.pdf

Find files and delete them

1
$ find . -iname \*t21* -exec rm {} \;

Find files and list its details

1
$ find / -iname \*iso -exec ls -l {} \;