LinuxQuestions.org
Visit Jeremy's Blog.
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 08-29-2011, 07:23 AM   #1
niharikaananth
Member
 
Registered: Aug 2011
Posts: 58

Rep: Reputation: Disabled
No such file or directory


Hi..everyone, In ubuntu10.10, if I do "locate any_filename" it is showing the path. But if I do the ls -l to the same path, it is showing no such file or directory. I tried with "find . / -name file_name", and I could not find any of my file. When I logged in, found there was no one files were on the desktop, & downloads but before there were lot files. If I search files from the desktop using locate command, it is showing file's path about every files. I tried with rescue CD also, but found the same problem. Could anybody please suggest me that how can I retreive my data And what may be the issue.
 
Old 08-29-2011, 07:27 AM   #2
jdkaye
Senior Member
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 4,535

Rep: Reputation: Disabled
You have to update the database before using the locate command. From a console issue this command
Code:
sudo updatedb
Supply your own password. Now locate should be up to date.
ciao,
jdk
 
Old 08-29-2011, 07:28 AM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,764

Rep: Reputation: 306Reputation: 306Reputation: 306Reputation: 306
The locate command depends on a database of the files on your computer. That database must be updated regularly to keep it current.

As root, run the command updatedb. When it is complete, try the locate command again.
 
Old 08-29-2011, 09:28 AM   #4
niharikaananth
Member
 
Registered: Aug 2011
Posts: 58

Original Poster
Rep: Reputation: Disabled
No such file or directory

I ran "sudo updatedb" command, it didn't take much time and returned within 2 to 3 seconds. After that ran "locate filename" but it is not showing any file path, I ran the same command after a reboot could not found any path to the file. But before running updatedb command atleast it was showing file path even it was unable to find the files using find command. And also ran "ls -la /home/username/Desktop" still there is no files. I just wanted to ensure that the files/folders which were stored on the desktop has got deleted completely?
Because before running updatedb command also, if I run "du -sh Desktop or du -sh Downloads" command it was showing 4k as size.
Could you please guide me, how can I retrieve my files?


Quote:
Originally Posted by jdkaye View Post
You have to update the database before using the locate command. From a console issue this command
Code:
sudo updatedb
Supply your own password. Now locate should be up to date.
ciao,
jdk
 
Old 08-29-2011, 09:37 AM   #5
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
The file you are looking for does not exist in the first place. "updatedb" hasn't been run since it was deleted, so "locate" thought it was still there.
 
1 members found this post helpful.
Old 08-29-2011, 12:46 PM   #6
niharikaananth
Member
 
Registered: Aug 2011
Posts: 58

Original Poster
Rep: Reputation: Disabled
No such file or directory

Thank you sir, Then what about files, should I use recovery softwares such as testdisk. or without such softwares I will be able to get backup my files?

Quote:
Originally Posted by MTK358 View Post
The file you are looking for does not exist in the first place. "updatedb" hasn't been run since it was deleted, so "locate" thought it was still there.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
chroot:cannot change root directory to: No such file directory janakiramulu Linux From Scratch 5 04-23-2011 01:00 AM
Get first file of directory then copy to other directory andd rename the file Faye Linux - Software 4 01-30-2011 09:16 AM
mkdir : cannot create directory : no such file or directory patcheezy Linux - Newbie 6 05-13-2009 11:26 AM
Copying a single file into each directory of a directory tree mlapl1 Linux - Newbie 2 06-27-2007 10:18 PM
How to protect a file/directory in your home login directory (RH Linux) jitsenho Linux - Security 9 07-03-2006 11:08 PM


All times are GMT -5. The time now is 05:52 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration