Databases
Showing results for 
Search instead for 
Do you mean 

search for a lost directory (Its out there somewhere!!)

SOLVED
Go to Solution
Occasional Advisor

search for a lost directory (Its out there somewhere!!)

Unix peeps

I have lost a directory which I know is called ~omyreally whats the best way to search for it?

Thanks for any help
you make me feel like dancing (gonna dance the night away!)
1 ACCEPTED SOLUTIONS
Honored Contributor Honored Contributor

Re: search for a lost directory (Its out there somewhere!!)

Does it really start with ~ ??
or are you referring too your home dir.
As thje user who created the dir
cd
ls -la

(or cd ~omyreally;pwd)
Later,
Bill
It works for me (tm)
6 REPLIES
Honored Contributor Honored Contributor

Re: search for a lost directory (Its out there somewhere!!)

Does it really start with ~ ??
or are you referring too your home dir.
As thje user who created the dir
cd
ls -la

(or cd ~omyreally;pwd)
Later,
Bill
It works for me (tm)
Honored Contributor Honored Contributor

Re: search for a lost directory (Its out there somewhere!!)

Depending on how you "lost" it, maybe fsck will "find" it for you and put it into the lost+found directory.

HTH
Marty
Esteemed Contributor Esteemed Contributor

Re: search for a lost directory (Its out there somewhere!!)

Slow, but exhaustive.

As root:

find / -type d -name \*omyreally\* -print


Where -type d means look for directories by this name.

Also, be aware that sometimes terminal misconfigurations and cause control characters to be entered into file and directory names. Having ^H embedded in a file name can cause problems. In that case, using ls -lRb from a higher level directory will help (recursively list all files and directories, long format, with non-printing characters displayed as /nnn).
Honored Contributor Honored Contributor

Re: search for a lost directory (Its out there somewhere!!)

If you know the parent directory, list and search by inode:

ls -i (* will list out unprintable file names *)

find /dir -inum ### -exec ll {} \;
Support Fatherhood - Stop Family Law
Honored Contributor

Re: search for a lost directory (Its out there somewhere!!)

a5:/u/usr/merijn 101 > perl -MFile::Find -MText::Soundex -le'$x=soundex shift;find(sub{-d||return;$x eq soundex$_ and print$File::Find::name},".")' tnp
./tmp
./.dt/tmp
a5:/u/usr/merijn 102 >

For you that could be

# perl -MFile::Find -MText::Soundex -le'$x=soundex shift;find(sub{-d||return;$x eq soundex$_ and print$File::Find::name},"/")' omyreally

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Highlighted
Occasional Advisor

Re: search for a lost directory (Its out there somewhere!!)

found it thanks for those suggestions
im dishing the points out now!

Happy Bob The Spod
you make me feel like dancing (gonna dance the night away!)