LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-15-2012, 04:17 AM   #1
ytyyutianyun
Member
 
Registered: Nov 2011
Posts: 63

Rep: Reputation: Disabled
How to list the deepest files' location


Click image for larger version

Name:	Capture.PNG
Views:	31
Size:	23.0 KB
ID:	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

Last edited by ytyyutianyun; 02-15-2012 at 06:33 AM.
 
Old 02-15-2012, 04:28 AM   #2
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,415

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
I think your solution is on this page:

http://stackoverflow.com/questions/2...rent-directory
 
Old 02-15-2012, 04:35 AM   #3
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
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
 
Old 02-15-2012, 04:40 AM   #4
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,415

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
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..
 
Old 02-15-2012, 04:44 AM   #5
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,613

Rep: Reputation: 433Reputation: 433Reputation: 433Reputation: 433Reputation: 433
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.

Last edited by malekmustaq; 02-15-2012 at 04:48 AM.
 
Old 02-15-2012, 06:28 AM   #6
ytyyutianyun
Member
 
Registered: Nov 2011
Posts: 63

Original Poster
Rep: Reputation: Disabled
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
 
Old 02-15-2012, 11:40 AM   #7
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,613

Rep: Reputation: 433Reputation: 433Reputation: 433Reputation: 433Reputation: 433
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.
 
Old 02-18-2012, 12:04 AM   #8
ytyyutianyun
Member
 
Registered: Nov 2011
Posts: 63

Original Poster
Rep: Reputation: Disabled
Thanks, I do multiple this command and can get the solution
 
  


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
Need advice on a script to search many files for list of terms, append hits to list jimmy the saint Programming 1 07-11-2010 04:59 AM
Kate: Append files to existing list and enable the Recent List AGazzaz Linux - Software 2 10-13-2009 09:27 PM
Hello from deepest, darkest Wiltshire markpope LinuxQuestions.org Member Intro 2 02-15-2008 03:14 PM
HowTo add specific location into sources.list? Mathsniper Debian 1 08-28-2005 05:21 AM
Did you know ... ? Microsoft's deepest secrets orange400 General 47 11-22-2003 09:56 AM


All times are GMT -5. The time now is 06: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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration