LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
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
 
LinkBack Search this Thread
Old 02-15-2012, 03:17 AM   #1
ytyyutianyun
LQ Newbie
 
Registered: Nov 2011
Posts: 25

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


Capture.PNG

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 05:33 AM.
 
Old 02-15-2012, 03:28 AM   #2
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Dehradun, Uttarakhand, India
Distribution: RHEL 5.3, CentOS 5, Fedora, Ubuntu, Debian
Posts: 1,198

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

http://stackoverflow.com/questions/2...rent-directory
 
Old 02-15-2012, 03: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,041
Blog Entries: 4

Rep: Reputation: 191Reputation: 191
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, 03:40 AM   #4
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Dehradun, Uttarakhand, India
Distribution: RHEL 5.3, CentOS 5, Fedora, Ubuntu, Debian
Posts: 1,198

Rep: Reputation: 273Reputation: 273Reputation: 273
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, 03:44 AM   #5
malekmustaq
Member
 
Registered: Dec 2008
Location: /root
Distribution: Slackware & BSD
Posts: 796

Rep: Reputation: 106Reputation: 106
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 03:48 AM.
 
Old 02-15-2012, 05:28 AM   #6
ytyyutianyun
LQ Newbie
 
Registered: Nov 2011
Posts: 25

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, 10:40 AM   #7
malekmustaq
Member
 
Registered: Dec 2008
Location: /root
Distribution: Slackware & BSD
Posts: 796

Rep: Reputation: 106Reputation: 106
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-17-2012, 11:04 PM   #8
ytyyutianyun
LQ Newbie
 
Registered: Nov 2011
Posts: 25

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
Trackbacks are Off
Pingbacks are On
Refbacks are 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 03:59 AM
Kate: Append files to existing list and enable the Recent List AGazzaz Linux - Software 2 10-13-2009 08:27 PM
Hello from deepest, darkest Wiltshire markpope LinuxQuestions.org Member Intro 2 02-15-2008 02:14 PM
HowTo add specific location into sources.list? Mathsniper Debian 1 08-28-2005 04:21 AM
Did you know ... ? Microsoft's deepest secrets orange400 General 47 11-22-2003 08:56 AM


All times are GMT -5. The time now is 03:20 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration