Jump to content

File search in Linux?

How do I do it?

MSI Performance Gaming AMD Ryzen 1st and 2nd Gen AM4 M.2 USB 3 DDR4 HDMI Display Port Mini-ITX Motherboard (B450I Gaming Plus AC), AMD Ryzen 7 2700 4.1 GHz, TEAMGROUP T-Force Vulcan Z DDR4 16GB (2 x 8GB) 3200MHz (PC4 25600) Ram, EVGA GeForce RTX 3060 Ti XC Gaming, 08G-P5-3663-KL, 8GB GDDR6, Metal Backplate, LHR
Link to comment
Share on other sites

Link to post
Share on other sites

In the command line, change to the directory you want to search in, then

find -name pattern

 

where pattern is what to search for in the filename.

 

(There are other things you can search by and for instead: see https://www.gnu.org/software/findutils/manual/html_mono/find.html)

 

Or alternatively, you can do it in almost every GUI file manager - usually by looking for a magnifying glass icon.

____________________________________________________________________________________________________________________________________

 

 

____________________________________________________________________________________________________________________________________

pythonmegapixel

into tech, public transport and architecture // amateur programmer // youtuber // beginner photographer

Thanks for reading all this by the way!

By the way, my desktop is a docked laptop. Get over it, No seriously, I have an exterrnal monitor, keyboard, mouse, headset, ethernet and cooling fans all connected. Using it feels no different to a desktop, it works for several hours if the power goes out, and disconnecting just a few cables gives me something I can take on the go. There's enough power for all games I play and it even copes with basic (and some not-so-basic) video editing. Give it a go - you might just love it.

Link to comment
Share on other sites

Link to post
Share on other sites

There's a dedicated graphical program called Catfish just for file searching. 

lumpy chunks

 

Expand to help Bunny reach world domination

(\__/)
(='.'=) This is Bunny. Copy Bunny into your signature to
(")_(") help him on his way to world domination.

 -Rakshit Jain

Link to comment
Share on other sites

Link to post
Share on other sites

As noted already, Catfish does this job really well.

 

Also, some file explorer programs have in-built searches that are really good. For instance, the one that comes with ZorinOS has a search bar on top that works really well.

Ryzen 1600x @4GHz

Asus GTX 1070 8GB @1900MHz

16 GB HyperX DDR4 @3000MHz

Asus Prime X370 Pro

Samsung 860 EVO 500GB

Noctua NH-U14S

Seasonic M12II 620W

+ four different mechanical drives.

Link to comment
Share on other sites

Link to post
Share on other sites

locate would be my choice, as it keeps a database of your files and does not need to dig through your hard disk every time you want to use it.

Write in C.

Link to comment
Share on other sites

Link to post
Share on other sites

  • Dolphin (a graphical file browser) has a search option. it should be at the top near "Show Previews" and "Split"
    It then opens a searchbar and allows you to select to search for files or inside actual content, where to look
    from here, where you are, "your files" probably all in your home dir or even use search tools you got installed like Kfind, FSearch or Catfish.
  • Thunar, another graphical file browser has the search option in the lower right and when you start typing, it searches in the folder your in.
    I guess this is what most filebrowsers allow, just start typing.
     
Link to comment
Share on other sites

Link to post
Share on other sites

most gui file manager have it build in (usually just start typing and it starts searching)

Link to comment
Share on other sites

Link to post
Share on other sites

16 minutes ago, yurimodin83 said:

find ./ | grep "nameoffile"

What is the point of piping find to grep when find can do the searching by itself?

____________________________________________________________________________________________________________________________________

 

 

____________________________________________________________________________________________________________________________________

pythonmegapixel

into tech, public transport and architecture // amateur programmer // youtuber // beginner photographer

Thanks for reading all this by the way!

By the way, my desktop is a docked laptop. Get over it, No seriously, I have an exterrnal monitor, keyboard, mouse, headset, ethernet and cooling fans all connected. Using it feels no different to a desktop, it works for several hours if the power goes out, and disconnecting just a few cables gives me something I can take on the go. There's enough power for all games I play and it even copes with basic (and some not-so-basic) video editing. Give it a go - you might just love it.

Link to comment
Share on other sites

Link to post
Share on other sites

More familar with grep than anything else. This is like people piping to some perl or python cli script for regex parsing sometimes. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

On 4/13/2022 at 3:14 PM, pythonmegapixel said:

What is the point of piping find to grep when find can do the searching by itself?

because you can do even more cool stuff if you are not 100% sure of the whole file name

$find ./ | grep -i "jpg" | grep -i "narrower" | grep -i "even_narrower"

 

this lets you search for partial filenames or bits and pieces if you don't remember.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×