Operating System - HP-UX
1833758 Members
2263 Online
110063 Solutions
New Discussion

how to list the directories in a filesytems

 
SOLVED
Go to solution
Binu_5
Regular Advisor

how to list the directories in a filesytems

Hi All

Can some one help me in finding the directories in a filesystem ...

Thanks
Binu
10 REPLIES 10
RAC_1
Honored Contributor

Re: how to list the directories in a filesytems

find /fs_mount_point -type d -exec ll -d {} \;
There is no substitute to HARDWORK
Arunvijai_4
Honored Contributor

Re: how to list the directories in a filesytems

# find / -type d

will list only directories in a FS.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Morcos
Super Advisor

Re: how to list the directories in a filesytems

Hi,
cd /fileSystem
ll -d

Regards,
Ziad
Cem Tugrul
Esteemed Contributor

Re: how to list the directories in a filesytems

find /fs_mount_point -type d -exec ll -d {} \;
is correct as RAC mentioned.

Good Luck,
Our greatest duty in this life is to help others. And please, if you can't
Cem Tugrul
Esteemed Contributor
Solution

Re: how to list the directories in a filesytems

cd /mount_point;
ls -lrt|grep "^d"
but this only shows 1st level directories;
mean let's say your moount point /oracle
and when cd oracle let's say 5 dir there
so you can only see these 5 dirs but these
5 dirs may(of course) have many sub_dirs
so you can not list these dirs with the command above.
Again i want to say that RAC's solution is
more significant...

Good luck,
Our greatest duty in this life is to help others. And please, if you can't
Binu_5
Regular Advisor

Re: how to list the directories in a filesytems

Hi

If I want to see the directories inside a directory ls -ld is not working properly
Is there any option along with ls ...
to list down only the directory


Thanks
Binu
Robert-Jan Goossens_1
Honored Contributor

Re: how to list the directories in a filesytems

Hi Binu.

Nor realy. you will need to combine two commands.

# cd /filesystem
# find . -type d -xdev | xargs ls -ld

-type d = search for directories
-xdev = avoid crossing any file system mount
points

Regards,
Robert-Jan
Morcos
Super Advisor

Re: how to list the directories in a filesytems

Hi Binu,
Try this, lsf -l |more / ,will list only directories.

Binu_5
Regular Advisor

Re: how to list the directories in a filesytems

Hi

I have found the directories using the following syntax
ls -lrt|grep "^d"

Thanks
Binu
harry_7
Frequent Advisor

Re: how to list the directories in a filesytems

Hi,

I have a question.

How to create a dir structure from one server to other server. In my oracle FTP_TOP I have more than 60 dir and then 5 sub dir's.

How I can replicate this dir structure on other server without the data.

Regards.

Harry.