Operating System - HP-UX
1748223 Members
4713 Online
108759 Solutions
New Discussion юеВ

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

 
SOLVED
Go to solution
bob the spod
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!)
6 REPLIES 6
Bill McNAMARA_1
Honored Contributor
Solution

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)
Martin Johnson
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
Bill Douglass
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).
Michael Steele_2
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
H.Merijn Brand (procura
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
bob the spod
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!)