LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 03-20-2018, 08:34 AM   #1
balaji7590
LQ Newbie
 
Registered: Jun 2012
Location: Bangalore, India
Posts: 6

Rep: Reputation: Disabled
Exclamation locate cmd not showing all the files


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:/#

----------------------------------------------------------------------------------

with regards,
Ram
 
Old 03-20-2018, 08:38 AM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,665
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
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.
 
Old 03-20-2018, 08:40 AM   #3
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
This is why I use find, which is my recommendation.
 
Old 03-20-2018, 08:50 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,897

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
Just a comment:
https://www.linuxquestions.org/quest...ad-4175614092/
 
2 members found this post helpful.
Old 03-20-2018, 09:03 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,652

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by balaji7590 View Post
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.
 
1 members found this post helpful.
Old 03-20-2018, 09:44 AM   #6
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
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.
 
Old 03-20-2018, 12:57 PM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
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.
 
Old 03-21-2018, 07:38 AM   #8
balaji7590
LQ Newbie
 
Registered: Jun 2012
Location: Bangalore, India
Posts: 6

Original Poster
Rep: Reputation: Disabled
locate cmd not showing all the files

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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cp all files from locate cmd to another machine (copy app from comp to another comp) zac_haryy Linux - Newbie 11 12-18-2013 02:00 PM
Issue sg_modes cmd at cmd line, want to see the cmd in binary form NuUser Linux - Newbie 1 03-28-2012 08:08 AM
[SOLVED] locate cmd couldnt search file but find did skaushal_lk Linux - Newbie 8 07-08-2010 06:44 AM
Difference between slocate and locate cmd's young_rhkid Linux - Newbie 3 10-13-2007 06:01 AM
No 'locate' cmd in SuSE 9.0?? pH* Linux - Newbie 12 01-18-2004 01:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration