Join Scott Simpson for an in-depth discussion in this video Find files from the command line, part of Learning Linux Command Line (2016).
- [Voiceover] We've been working with our exercise files,…which is a limited set of files…we can explore pretty easily,…but sometimes you'll need to look for a file…if you don't know where it is.…For that, we have the Find command.…Find has a lot of options which are worth exploring…as you build your command line skills.…For now, we'll take a look at basic usage.…To use Find, I'll type find…and then the scope of where I want to search.…I'll use . for the current working directory,…which is my exercise files,…and then I'll type -name,…which is the test I'm using to match files.…
I want to match them based on their name.…There are other options,…like group permissions and so forth,…but I find that I use Name the most.…Then, I'll put a matching pattern for what I'm looking for.…I'll put "poe*" in double quotes.…The * wildcard will match any number of characters.…This should find our poems.txt file,…and when I run the command, sure enough, it did.…Let's try another search.…I'll write find . -name "do*".…This finds a folder called Documents…
This course will establish the foundation for more advanced Linux topics. Find other Linux training courses here.
- What is the Linux command line?
- Writing Linux commands at the prompt
- Finding help for Linux commands
- Editing files and folders
- Configuring user roles and file permissions
- Using pipes to connect commands
- Peeking at files
- Searching and editing text
- Finding disk and system information
- Installing and updating software