Find command with some examples


Find command is available by default in most of the Linux distros so you don’t need to install any packages to get this command. Find command is very useful to search it for a particular file based on various search criteria like permissions, ownership, modifcation of date/time etc., Using find command even you can search it for specific files and remove it. We will see below with some examples of Find command.

1. Finding files with particular extension.

# find /etc/ -type -f -name "*.conf"

2. Finding files using the name in current directory

# find . -name "test.txt"

3. Find and remove zero size files

Removing the zero byte files in current directory.

# find . -size 0 -exec rm {} \;

Suppose if you want to remove the empty files in /tmp directory likewise you can remove it in any directory

# find /tmp -size 0 -exec rm {} \;

Recommended For You

About the Author: admin

Leave a Reply

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

Subscribe To Our Newsletter
Subscribe to our email newsletter today to receive updates on the latest news, tutorials and special offers!
No Thanks
Thanks for signing up. You must confirm your email address before we can send you. Please check your email and follow the instructions.
We respect your privacy. Your information is safe and will never be shared.
Don't miss out. Subscribe today.
WordPress Popup Plugin