find command in linux | Pro Tech guides

find command in linux

Find command in linux allows you to search for files and folders. You can also search by extension, filename and time.

find command in linux | with pictures

find command in linux
Linux command find

Hello, guys Today I'm going to show you how You can use "find" command in Linux.

What is "find" command?

"find" command is used to search for files in a directory hierarchy.

Find Command

find files using find command
Find command

$find [directoryName] -name [fileName]

For example, I want to find "file1.txt". Which I have created a few days ago. I don't know which folder is it. I just know that it's in the root directory of my operating system.

So I can use "find" command for this so just use "find / -name file1.txt" and press ENTER

It's going to search in all the directories and files in this root directory and then it's going to search where is this file located and prints the output.


Search by File Name

search file name in linux using find command
search files

$find [directoryName] -name fileName.*

For example, I just know that this file is called "file1" but I don't know the extension.

In this case, you can use ".*" (Asterisk) as a wildcard.

  • This means that whatever comes after "file1." then it will go to search for all those files.

I'm going to write "find /desktop -name file1.*" and press ENTER

Search by extension

linux command find search by extension
search extension

$find directoryName -name *.extension
For example, I just want to search for ".txt" extension the files which have the "txt" extension.

I just give "find /desktop -name *.txt" and press ENTER

Result which has a ".txt" extension is going to be listed.

Search files and folders

linux command find to search files and folders
search files and folders

$find directoryName -name fileName*
I want to search for the particular files and folder called "file1".

I just want to write "find /desktop -name file1*" and press ENTER

  • Whatever files and folders which will start from "file1" are going to be searched and listed in our result.

So in this way you can search for the file and folder in your directory in which you want to search.

Search files by Time

linux command find search by time
Search by time

$find / -mtime -1

For example, You have created a file and you just know that you have created this file a few days ago.

But you don't know the name of the file and you don't even know the location of the file.

So, In this case, you can use "find / -mtime -1" press ENTER

  • "-1" is going to look at the files which are created one day ago to till now.

This can be plus also so you can know that from this time this will be created.

Conclusion

So this is how you can use this "find" command in Linux.

I hope you've enjoyed this tutorial please rate comment and bye for now.

HAVE A NICE DAY💖

Name

Apps,3,Games,1,Linux,38,Linux Commands,37,Network-Devices,1,Networking,1,Terminal Apps,2,Termux,17,Userland,3,Windows,1,
ltr
item
Pro Tech guides: find command in linux
find command in linux
Find command in linux allows you to search for files and folders. You can also search by extension, filename and time.
https://1.bp.blogspot.com/-XbwCSXGNfRQ/YCvHq6UpwXI/AAAAAAAADHg/Ljkq8jQN9cQbiPXAZ4ciOSiwi1ud2mROgCNcBGAsYHQ/s16000/find-command-in-linux.png
https://1.bp.blogspot.com/-XbwCSXGNfRQ/YCvHq6UpwXI/AAAAAAAADHg/Ljkq8jQN9cQbiPXAZ4ciOSiwi1ud2mROgCNcBGAsYHQ/s72-c/find-command-in-linux.png
Pro Tech guides
http://www.protechguidez.com/2021/02/find-command-in-linux.html
http://www.protechguidez.com/
http://www.protechguidez.com/
http://www.protechguidez.com/2021/02/find-command-in-linux.html
true
7053638852026728047
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content