


We want to search for all files which match some pattern. How would I find all mp3’s that begin with “Laptop”? find - use the find command ~ - search only within the user's home directory -name - what to search for("-name" = a file's name) "LaptopLikeYou.mp3" - the name of the file we want to look forĢ. How would I find a file named “LaptopLikeYou.mp3” on my computer?ĭemoMachine:~ juxtaposedwords$ find ~ -name "LaptopLikeYou.mp3" So let’s breakdown what that command is actually doing.You always perform commands from a particular place (the “working directory”)Įver had trouble finding that one file mp3 in your directory? If we’re using the Finder GUI, we’d use the search functionality in the top right of every finder window however, we will use the Find command, to go through some possibilities.įind- used to find files a CLI equivalent to Mac’s Finder search feature.man - looks up the documentation on the given command.cd - change your current directory to “”.DemoMachine - the name of the computer I'm using ~ - the current directory(see note below) juxtaposedwords - the user I’m logged in as $ - tells us where the cli prompt starts A note on "~" - the tilde is commonly used to represent the current user’s home directory
