Comments on 16 Practical Examples of Linux Find Command for Beginners
Find is one of the most frequently used Linux commands, and it offers a plethora of features in the form of command line options. In this tutorial, which is aimed at beginners, we will discuss the basic usage of the command as well as some of the useful command line options it offers.
4 Comment(s)
Comments
Hello all,Very good content!
I think it could be interesting to add the following command,It is useful when you know the text but don't know the file you stored it.
grep -iR "text you want to find inside file"
Regards, Gustavo.
This grep example is nice, but the article itself is about the program called find. So the logic behind your comment is like: "Yes, you wrote great article about how to prepare sushi, but look, this recipe for fish and chips is also great and you did not include it in your article..." :-) Ok, maybe next time they will publish another article about grep (maybe they already did) and thent I can imagine that there could be a link at the and of the article: "And sometimes when the find program is not sufficient for your needs, you can try to use another program called grep (link there)."
Hi, thanks for this. I'm trying to find, for example the vpn files on a fedora machine. The entire thing. So I want, ideally, to say: find *vpn* and have the command search the entire computer for any and all entries that have vpn anywhere in their name. It's going to be in root somewhere.
As is probably obvious I've not much idea what I'm doing and almost no idea of how to use find even after some time reading tutorials.
It seems to me find can't really find anything unless you already know where to look. I mean if I know the path to a file then I, by definition, know where it is.
Should I be looking at grep?
Can anyone help me out, please? Thanks
Hi Pete, it sounds like you do know that it is somewhere in root, you just need to use root as the starting point. It just might take a long time and you might end up with lots of false positive matches. You might also want to try the locate command since it's a simplified function, while grep is going to have more options that can get complicated.