Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Dear All,
When I execute locate command some files are not showing, and its available when I execute ls command. And other files also able to locate with locate command.
I need to know why some files which i tried to search is not available. I have pasted the terminal output, kindly guide me.
----------------------------------------------------------------------------------
root@kali:/# ls
0 dev home lib media proc sbin tmp vfmfileresults.html vmlinuz.old
bin etc initrd.img lib64 mnt root srv usr vfmfiles
boot -f initrd.img.old lost+found opt run sys var vmlinuz
root@kali:/# ls -l | grep vfm
-rwxrwxrwx 1 root root 4015 Mar 20 17:56 vfmfileresults.html
drwxr-xr-x 2 root root 4096 Mar 20 17:56 vfmfiles
root@kali:/# locate vmlin
/vmlinuz
/vmlinuz.old
/boot/vmlinuz-4.14.0-kali3-amd64
root@kali:/# locate vfmfile
root@kali:/#
root@kali:/#
The locate command relies upon a database built and maintained by the command updatedb, which is usually run every day or so by a system-level scheduled task.
As the cited man-page indicates, there are various options which determine what files are included in this index, and what results will be shown to a particular user.
Last edited by sundialsvcs; 03-20-2018 at 08:39 AM.
Dear All,
When I execute locate command some files are not showing, and its available when I execute ls command. And other files also able to locate with locate command. I need to know why some files which i tried to search is not available. I have pasted the terminal output, kindly guide me.
As pan64 said, one of the main problems you're having is because you're using Kali....which you should NOT USE. It is for advanced users and network/security testing only. Not to be used as a daily use distro, and it even says this on their website.
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
The advantage of locate is speed. But it doesn't usually index absolutely every file. I use locate a lot. But I know the file should be there, and locate turns up nothing, I'll try find.
that's why i don't use (and don't recommend) locate.
to the careless user, it creates the illusion of finding files, but in reality it only ever finds what is in its database.
it's easier to use and faster than find, but all too many people do not know the above.
dear all,
thanks for your answer. one more thing I understood is that I don't use Kali at this stage, but my profession is demanding. So as per your suggestion I will install Debian os and work with that as well.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.