There are many ways you can go about configuring locate in and outside of Emacs. But for most of my personal use cases, I'm more interested in finding files recursively inside a specific project's scope, and that's what we'll be discussing next. This can obviously save you time when your looking for a file, but can't remember where it's located. This buffer also features some additional functionality, but we won't be covering that today. When running this command you can pass it a string, and locate will then look through the database for all the matching paths, and lists all the results in an Emacs buffer. Using locate in combination with EmacsĮmacs already has a command named locate. The brew version of these commands will be prefixed with a g, so you'll need to run glocate and gupdatedb. On Linux you should be all set, but if your on a Mac, please conceder installing findutils, via brew, instead of trying to use the default locate and updatedb commands. You can also make use of shell globbing and quoting characters to help narrow the results. All you need to do is run locate pattern to find matches. It does this almost instantly, making it a great choice to find files inside of unknown locations. Once the database has been generated, you can use locate to find all matching file paths inside of the database. The command used for updating the database is called updatedb. Locate is a program that searches for a specific pattern inside a database that contains pathnames. Listen To Episode | YouTube Video What is locate? 1 - Finding Files Recursively Using Locate
0 Comments
Leave a Reply. |