Basic Find Commands

Basic Find Commands for Finding Files with Names
1. Find Files Using Name in Current Directory

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

# find . -name weballround.txt

./weballround.txt

2. Find Files Under Home Directory

Find all the files under /home directory with name weballround.txt.

# find /home -name weballround.txt

/home/weballround.txt

3. Find Files Using Name and Ignoring Case

Find all the files whose name is weballround.txt and contains both capital and small letters in /home directory.

# find /home -iname weballround.txt

./weballround.txt
./weballround.txt

4. Find Directories Using Name

Find all directories whose name is weballround in / directory.

# find / -type d -name weballround

/weballround

5. Find PHP Files Using Name

Find all php files whose name is weballround.php in a current working directory.

# find . -type f -name weballround.php

./weballround.php

6. Find all PHP Files in Directory

Find all php files in a directory.

# find . -type f -name "*.php"

./weballround.php
./login.php
./index.php

Comments

Popular posts from this blog

Centos 7 Setup Webmin, Virtualmin, Usermin, CSF Firewall and Letsencrypt

Setting Up Out-of-Office Messages in Outlook

How to install Openbox