![]() This can perfectly done with find, but I can imagine it will take a long time searching through 1TB (depends more on the amount of files, not necessarily the total size). ![]() But I think Chaitanya want to search for example for 'all files created before 2011'. If you want to search on filename, a combination of locate, find, ls and grep could be sufficient. What method do you prefer for file finding? Reply below and I’ll $ grep Nixie * it later.I haven't seen an answer that comes near the wishes of Chaitanya. If you want the full power of find, you’ll need to run it from the command line, using the quick tips above. Think of Catfish as an equivalent to Windows Search. mv -v displays the results of the move command with (-v)erbose messages.Īnother warning with -exec, though it is powerful, when used without care you can overwrite your whole home directory or whole disk – so be careful! Catfish is a GUI Optionįor those of you who simply can’t do without a GUI, you can find the program Catfish in the repositories - this enables you to run both locate and find from a graphical front-end, but it is very limited in options. So all your files will be moved to the same place. You can add sudo here because find does not search files/directories that the current user does not have permissions for, and it will return error messages if you aren’t a sudoer - just be careful! $ find ~ -iname "*new*" -exec mv -v ) to /media/current-projects/ ( \ is required by -exec to show the end of the command to be executed). This would be useful if you know you edited a file recently but don’t know where you put it, or have to find a log file for a program that crashed. This example will find (starting at the root directory, or /, and recursively search subdirectories) all normal files ( -type f means normal files, without this it will find normal files + special files + directories) which were modified less than ten minutes ago (-mmin -10), and then display the results for you. Two examples: $ sudo find / -type f -mmin -10 “), uses no search criteria (defaults to showing all files), and -print (which, despite its name, displays, or “prints,” the results on screen) as the only action to take. If you don’t add any parameters, find will default to searching the current working directory (or “. You can tell “find” where to look, what criteria to use in its search, and what actions to take once you have found what you are looking for. There is a much more powerful command available to you called “find”. The only problem is that newly created or moved files may not be found correctly until the next database update, and you don’t have many options to choose from for your search.įorcing locate to update the database/index is done with sudo updatedb and it doesn’t take a lot of time.Įxample: $ locate -i sktop Find The results are instantaneous because the system has created a database (also known as an index) to tell you where files are located. it will find searchstring, Searchstring, sEaRcHsTrInG, and so on). This will search for all files and directories with “searchstring” in the name, and -i means the search is not case sensitive (i.e. To use this command at the terminal you simply type: $ locate -i searchstring The easy, quick command is called “locate”. With just a small amount of patience you can find files quickly and easily using the command line, and your options for this are really powerful if you want to learn a bit about it. ![]() ![]() Unfortunately in Linux, certainly Ubuntu, the default GUI file search is not the most useful way to find files.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |