I am trying to teach myself some Linux commands using Ubuntu Mate 15.04 and am having trouble with the locate command. I am in a directory that contains a file called testfile.txt. I then run the following commands:
sudo updatedb
locate testfile
However, the system does not return any results. Running ls testfile* does return the file name.
I upgraded to 15.10 last night and tried it again but still no luck. Is there a way to reinstall that command?
I don’t really have a structured approach to my self-education (though I could really use one!). For now, I’ve been Googling various sites and working my way through the Linux Foundation’s Introduction to Linux course.
But I will take a look at your suggestion too! Thanks!
Thank you for the reply, lah7. I tried your suggestion (which is what I was looking for) but unfortunately, locate still can’t seem to locate a simple test file, even after I ran sudo updatedb.
Oh well, no big deal. I think there are still other ways to find files via the command line. It’s just curious that this didn’t work. The funny thing is that when I tried it, it returned:
/usr/share/perl15/Mail/Mailer/testfile.pm
but not the testfile.txt that is in the directory from where I ran the command!