![]() ![]() The command line allows you to pass the results of a search directly into another Linux command as input. And you can do more with the files you do find from a command-line search than with a GUI file explorer search. You can also use the same wildcard characters for partial filenames or to find all files of a certain type and files with similar names. The pathname for the directory you pass to the command can be absolute or relative, so that the above command can also be written like this and it will work the same: sudo find. When searching from root, you'll need to have root privileges to even read the contents of certain directories, so you'll need to prefix your command with sudo. If you open a terminal window, you'll begin in the same home directory as with the desktop file explorer, but rather than navigate to root to begin a search, you can simply tell find to start in the root folder: sudo find / -name filename The directory doesn't need to be the current working directory, it can start a search beginning in any directory from any directory. Explore the different Linux desktop environments and find the right one for you.These lists can be unintentionally large, so don't make the search term so broad as to make the results list meaningless. If you don't know the exact file or directory name you're looking for, you can use wildcards characters to search for partial or incomplete matches to your search term. Learn which are the best Linux distros for beginners.For example, searching for the word "term" will return "term", "terms", "terminate", "terminal", "determine", and so on. This is because the default behavior for Linux's is a so-called "greedy" search, which will err on the side of returning files that might be the file you're looking for, even if it barely qualified as a match. jpgs) since these tend to return larger-than-intended lists of possible matches. This is especially helpful when using very broad search terms or if you want to find all files of a specific type (i.e. Check out the best Linux training providers and online coursesĬonversely, if you want to narrow your search results, start moving down through the subdirectories most likely to contain what you are looking for before searching.Look for an up arrow next to the address bar or a side panel with essential file system locations. If you want to expand your search, navigate up through the directory tree as high as you need to (with the root, or /, directory being the highest possible) and then perform your search.ĭifferent interfaces handle file system navigation differently, so how to move up the trees might not be as intuitive as moving down the tree through subdirectories. Since Linux only searches from the current working directory and lower for a file, you might need to navigate to an appropriate directory in which to begin a search. You can skip this, but using it you'll get more information like the file size, permissions, the modification date, etc.If you don't see a file or directory that you know should be there, chances are that you need to broaden the directory scope of the search. ![]()
0 Comments
Leave a Reply. |