HostOnNet Blog

Basic “Find” Commands for Finding Files

Looking for Linux Server Admin or WordPress Expert? We can help.

Find all the files whose name is New.txt in a current working directory.

stefin@fwhwin:~$ find -name New.txt
./Desktop/New.txt
stefin@fwhwin:~$ 

Find Files Under Home Directory

 # find /home -name 'timthumb.php'
/home/meonly/public_html/forest/themes/safari/timthumb.php
/home/arunkomb/public_html/couch/includes/timthumb.php
/home/meagain/public_html/me/themes/photos/lib/utils/timthumb.php
/home/photos/public_html/photo/themes/prabu/scripts/timthumb.php
/home/photos/public_html/photo/themes/nandu/functions/timthumb.php
/home/nasarani/public_html/wp-content/plugins/thethe-image-slider/timthumb.php

Find Files Using Name and Ignoring Case

stefin@fwhwin:~$  find /home -iname new.txt
/home/stefin/Desktop/New.txt

Find all files having .txt extension

find /home/stefin -name ‘*.txt’

stefin@fwhwin:~$ find /home/stefin -name '*.txt'
/home/stefin/work.txt
/home/stefin/Downloads/Vineesh/vineesh.txt
/home/stefin/Downloads/otrs_cmds.txt
/home/stefin/.adobe/Flash_Player/AssetCache/SARVQ32E/cacheSize.txt
/home/stefin/payments.txt
/home/stefin/Desktop/noip.txt
/home/stefin/Desktop/ffmpeg.txt
/home/stefin/Desktop/Office_Network_Enable.txt
/home/stefin/.mozilla/firefox/4i2hume5.default/cert_override.txt
/home/stefin/.mozilla/firefox/94kehjnj.default-1400219860240/urlclassifierkey3.txt
/home/stefin/.mozilla/firefox/94kehjnj.default-1400219860240/cert_override.txt
/home/stefin/.pki/nssdb/pkcs11.txt
/home/stefin/.teamviewer/6/drive_c/users/stefin/Application Data/TeamViewer/Connections_incoming.txt
/home/stefin/.config/libreoffice/3/user/uno_packages/cache/log.txt
/home/stefin/.config/google-chrome/Default/Pepper Data/Shockwave Flash/CacheWritableAdobeRoot/AssetCache/MWZDBGTY/cacheSize.txt
/home/stefin/.config/google-chrome/chrome_shutdown_ms.txt
/home/stefin/.config/chromium/chrome_shutdown_ms.txt
stefin@fwhwin:~$ 

About Annie

I've been working in Technical Section for over 10 years in a wide range of tech jobs from Tech Support to Software Testing. I started writing blog for my future reference and useful for all.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.