LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-30-2007, 11:48 AM   #1
mcupples
Member
 
Registered: Jun 2006
Location: Orlando
Distribution: FC3, FC5, CentOS4, Ubuntu 6.06
Posts: 57

Rep: Reputation: 15
Finding a Moved File: Fedora Core 3


Okay, this is strange. We have a folder on our internal network that just disappeared. I realize it was likely deleted, but how do I tell for sure what happened to it? I already checked history on root to see if it was rm'd but it wasn't. Hopefully someone was just in windows and accidentally moved it.

Any ideas on how I can figure this out? It's a Fedora Core 3 server running a Samba (3.0.10) share for the Windows users. I tried Googling for a few different related terms and didn't find anything. Perhaps there's a log for all users I don't see? I could grep through that log if I could find it.

The reason I can't just grep for the folder name is because that folder name is incredibly common. I tried that and got over 50k lines of matches. Unless someone knows a way to grep for JUST folders called XXX. Right now my grep knowledge is limited, I normally just use "grep -rl "whatever" *".
 
Old 03-30-2007, 12:12 PM   #2
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
You can run the find command:

find / -name "*foldername*"
 
Old 03-30-2007, 12:49 PM   #3
mcupples
Member
 
Registered: Jun 2006
Location: Orlando
Distribution: FC3, FC5, CentOS4, Ubuntu 6.06
Posts: 57

Original Poster
Rep: Reputation: 15
Find Command

Well, that worked just about as well as grep did. Everything, including files, not just folders came up. Although this did return fewer matches as it did not look inside of the files, I believe.

Is there no way to further narrow the results down to only folders? I'm still dealing with 50k+ (my ssh client is set to stop at 50k lines) files. I'd set my scrollback further, but my computer already runs slow with that much on the screen as it is. I've only got 512mb ram on the laptop that I use to ssh in.
 
Old 03-30-2007, 01:09 PM   #4
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Use:

find / -type d -mount -name "*foldername*"

From 'man find':


-mount : Don’t descend directories on other filesystems.

-type d : directory

Last edited by macemoneta; 03-30-2007 at 01:11 PM.
 
Old 03-30-2007, 01:18 PM   #5
mcupples
Member
 
Registered: Jun 2006
Location: Orlando
Distribution: FC3, FC5, CentOS4, Ubuntu 6.06
Posts: 57

Original Poster
Rep: Reputation: 15
Thanks!

Yep, this worked perfectly. I have no idea why I always try google before man. Guess I won't make that mistake again.

Thanks much!
 
Old 03-30-2007, 01:35 PM   #6
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
In addition to find one could also use (s)locate, if the database is updated:
Run as root,
Code:
updatedb
updates the (s)locate database. Then
Code:
locate directoryname
searches the database for 'directoryname' (don't use asterisks * or other wildcards, unless the filename includes them). You can then use grep with the information to narrow it down more.

By the way, I'm not sure what the official naming scheme of RedHat products is at the moment, but I always tend to think "RedHat x" where x is a version number, refers to the old RedHat Linux distributions that ended with RedHat 9. At some point I thought the newer ones were either Fedora Core x or RedHat Enterprise Linux (RHEL) x..

Last edited by b0uncer; 03-30-2007 at 01:37 PM.
 
Old 03-30-2007, 02:57 PM   #7
mcupples
Member
 
Registered: Jun 2006
Location: Orlando
Distribution: FC3, FC5, CentOS4, Ubuntu 6.06
Posts: 57

Original Poster
Rep: Reputation: 15
Erm, nope. That solution doesn't do much there for me. The find thing totally looked solely for directories. Locate looks for everything, I believe.
 
  


Reply

Tags
file, folder, lost



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
Fedora Core 4: not finding CD drive Ace27 Linux - Newbie 2 01-17-2007 10:34 AM
Finding and Adding Channels For Fedora Core 2 caal Linux - Newbie 1 11-05-2006 09:49 AM
Need help finding Lexmark Z6xx driver for Fedora Core 5 Antarctica Linux - Hardware 1 09-08-2006 10:12 PM
Need help finding GCC on Fedora Core 5 CD Antarctica Linux - Software 2 09-06-2006 11:23 PM
Finding fat32 partitions on a second hd in fedora core 1 PsychoFarmer Linux - Software 5 01-04-2004 10:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:40 PM.

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