Xnone
(Xmonkey)
March 5, 2024, 6:05pm
1
┌─[parrot@parrot]─[~/Documents/tes]
└──╼ $ls
Dvwa.txt
┌─[parrot@parrot]─[~/Documents/tes]
└──╼ $sudo updatedb
[sudo] password for parrot:
┌─[parrot@parrot]─[~/Documents/tes]
└──╼ $locate Dvwa.txt
I want to find the location of Dvwa.txt file using locate, after I do sudo updatedb and do a search with the command “locate Dvwa.txt” nothing comes up, how do I solve it ??
Masmer
(Masmer Snerd)
March 6, 2024, 2:00am
2
Hi @Xnone
Maybe delete the /var/cache/locate/locatedb file and rebuild?
┌─[masmer@cracker]─[~]
└──╼ $touch Dvwa.txt
┌─[masmer@cracker]─[~]
└──╼ $ls
Desktop Downloads Music Public Videos
Documents Dvwa.txt Pictures Templates
┌─[masmer@cracker]─[~]
└──╼ $sudo updatedb
/usr/bin/find: '/run/user/1000/doc': Permission denied
/usr/bin/find: '/run/user/1000/gvfs': Permission denied
┌─[masmer@cracker]─[~]
└──╼ $locate Dvwa.txt
/home/masmer/Dvwa.txt
Xnone
(Xmonkey)
March 6, 2024, 2:39am
3
┌─[root@parrot]─[/home/parrot]
└──╼ #ls /var/cache/locate/locatedb
ls: cannot access '/var/cache/locate/locatedb': No such file or directory
file /var/cache/locate/locatedb doesn’t exist. I installed locate with apt install mlocate
Masmer
(Masmer Snerd)
March 6, 2024, 3:01am
4
Xnone:
mlocate
/var/lib/plocate/plocate.db
┌─[user@parrot]─[~]
└──╼ $sudo apt install mlocate
┌─[user@parrot]─[~]
└──╼ $touch mytext.txt
┌─[user@parrot]─[~]
└──╼ $locate mytext.txt
/var/lib/plocate/plocate.db: No such file or directory
┌─[✗]─[user@parrot]─[~]
└──╼ $sudo updatedb
┌─[user@parrot]─[~]
└──╼ $locate mytext.txt
/home/user/mytext.txt