Users can choose from several standards such as either search a matching filename or time range that matches when the file was accessed or modified. Therefore it is a utility for file hierarchy, where not only the user can leverage it to find data but also perform successive operations on it. More so, using the command, users can set specific search criteria and actions on files that match the search. It can search based on various criteria such as name, size, date modified, and others, and perform actions on the results such as printing, deleting, or executing other commands.įind Command is a command-line utility that locates files in one or more directory trees. Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen."find" is a command-line utility in Unix-like operating systems that is used to search for files and directories in a specified location. For more information, make sure to read the man page with the command man find. Using the find command isn’t the most intuitive means of locating files from the command line, but once you get used to it, you’ll find it incredibly powerful and useful. That find command would prune out /proc, /run, and /snap to make it even easier to locate the file you’re looking for. If you want to prune multiple directories, you’d have to make use of a regular expression like this: find / ( -path /proc -o -path /run -o -path /snap ) -prune -false -o -name 'dev.conf' Although this will still include directories like /run and /snap (which would unlikely house your file), the output would be significantly easier to comb through and locate your file. What that command does is search the entire filesystem for a file named dev.conf, but leaves out the /proc directory in the process. Such a command might look like: find / -path /proc -prune -false -o -name 'dev.conf' To fix that we have to make use of a few options to prune away directories like /proc and get a bit more specific. Because of this, the output of the command will be far too long to be useful. The problem with that command is it’s not only going to search every directory in the hierarchy, it’ll also include directories (such as /proc) that most certainly won’t house your file. Using the find command you could do a quick search through the entire filesystem with the command: find / dev.conf Let’s say you have a file named dev.conf and you can’t remember where you saved it. SEE: A guide to The Open Source Index and GitHub projects checklist (TechRepublic Premium) How to use the built-in find command Let me show you how to use this built-in command. The find command is a powerful search command that can easily help you find the files you’re looking for. Your best bet is to make use of the built-in CLI search tools, such as find. Where did you leave that one particular configuration file you were just working on? You could start poking around in the directories that you assume might house the file using the ls command, but that could take far more time than you’d like to spend on this quest. 6 Best Linux project management software in 2023Ħ best open-source kanban boards for managing projects in 2023Ħ Best Free Alternatives to Microsoft Word (2023 Update)
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |