Mlocate.db: regular file, no read permission Which says that the database is in /var/lib/mlocate.db, but this (just below) is what I got, and when opened in a text editor the message was that the data was unreadable: :/var/lib/mlocate$ ls Ubuntu Manpage: updatedb - update a database for mlocate rwxr-xr-x 1 root root 43768 updatedb.mlocate You get the above symlink to /usr/bin/updatedb.mlocate :/usr/bin$ ls -l updatedb.mlocate Lrwxrwxrwx 1 root root 25 Jul 15 02:35 updatedb -> /usr/bin/updatedb.mlocate If I look in /etc/alternatives :/usr/bin$ cd /etc/alternatives If I look in /usr/bin and long-list updatedb, it is linked (light blue link - and with an 'l' in the permissions, so a symlink) to /etc/alternatives/updatedb. This is what I have done to try and find it: :~$ sudo find / -name updatedbįind: ‘/run/user/1000/gvfs’: Permission denied It is not there on ubuntu (xubuntu), and it doesn't even seem to be locate-able (ironically) in principle. For more information, be sure to check out the man pages for each of them.I have been reading about the locate command, and the tutorial I was using says that /var/log/updatedb is where the updatedb is located. These are just a few basic examples of how to locate files from terminal. In case all we know is that we accessed the file five minutes ago, the command to use will be: sudo find ~/ -amin -5įor learn more about find, open a terminal and type: That the file is less than 5 MB in size and more than 3: sudo find / -size -5M -and -size +3M For this example, I will use a command that combines the above data. size +3Mįind supports Boolean operators to make the search more exact. In case you know that weighs more than 3MB, the command to use would be: find. If all we remember is that file is less than 5MB in size. That is something that we will not find in locate. Now, if we replace the parameter '-name' with '-iname', it could get results without taking into account the exact letters. This will tell us in this case that there is a pdf file called ' poo-php'in the Documents folder. The first thing to do is navigate to the documents folder and then type the command: We know that the file name contains the word ' php', but we don't exactly remember the name. Let's say we want to search for a file in the documents directory. If you want to search your entire file system, use ' /'. If you want to search your home directory, replace the period with ' ~/'. The dot tells find to search the current directory. If you know where the file can be, open the terminal (Ctrl + Alt + T) and go to the directory to run: find. This will speed up the search process, depending on the size of the directory. If possible, the first thing we should do when executing it is instruct it to search in a specific directory. It's perfect for when you try locate a file or directory but can't remember its exact name.įind can search for files that belong to a certain user or group of users, files that were modified or recently accessed, files of a specific size range, hidden files, etc. This is because it actually searches our drives for files and directories. Fd, an alternative to the find command, simple, fast and easy to useĮl find it is a much more powerful but also slower search utility.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |