LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to list the deepest files' location (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-list-the-deepest-files-location-929427/)

ytyyutianyun 02-15-2012 03:17 AM

How to list the deepest files' location
 
1 Attachment(s)
Attachment 9089

Like this picture
I only want to list the deepest files' location to the file as
*\*\89
*\*\111
.....


(No "")

Thanks


Thanks all of you
But the "89" is only an example
And Before this may be I don't know any name of the folder. Then how can it be.
Thanks

Satyaveer Arya 02-15-2012 03:28 AM

I think your solution is on this page:

http://stackoverflow.com/questions/2...rent-directory

deep27ak 02-15-2012 03:35 AM

I am not very sure if this is what you want

Code:

#tree -f /path/to/dir | grep 89
and just to list you can use
Code:

#tree /path/to/dir | grep 89  <--but it will not show full path

Satyaveer Arya 02-15-2012 03:40 AM

Yeah deep27ak, that's what on this page:

http://stackoverflow.com/questions/2...rent-directory

using tree command you can list the deepest files in a directory..

malekmustaq 02-15-2012 03:44 AM

Try xargs with null.

Say--
Quote:

sudo find /some_root_folder_here -type d -name "89" -print0 | xargs -0 ls -al
It will list the contents of '/89' wherever it is found. You just specify the "some_root_folder" against which you are trying to list some remotely deep folders. It will certainly return the full path of the folder. It did to mine.

Hope that helps.

Goodluck.

ytyyutianyun 02-15-2012 05:28 AM

Thanks all of you
But the "89" is only an example
And Before this may be I don't know any name of the folder. Then how can it be.
Thanks

malekmustaq 02-15-2012 10:40 AM

Quote:

And Before this may be I don't know any name of the folder. Then how can it be.
The best rule for easy finding is to first know what you are looking for.
:)
Meantime test that code under /proc. Look for a folder named /stat somewhere below it and list the contents. Say try this code:

Quote:

sudo find /proc -type d -name "stat" -print0 | xargs -0 ls -al
Count how many folders it finds of same name but different tree and different contents listed.

Enjoy.

ytyyutianyun 02-17-2012 11:04 PM

Thanks, I do multiple this command and can get the solution


All times are GMT -5. The time now is 08:37 PM.