System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

list files in all subfolders

SOLVED
Go to solution
Fernando Boza
Regular Advisor

list files in all subfolders

I need list all files including files into subfolders with your permissions.

10 REPLIES
Raj D.
Honored Contributor
Solution

Re: list files in all subfolders

#ls -lR #or# find . -type f -exec ls -l {} \;
" If u think u can , If u think u cannot , - You are always Right . "
Steven Schweda
Honored Contributor

Re: list files in all subfolders

> #ls -lR #or# find . -type f -exec ls -l {} \;

Perhaps.

man ls
Look for "-l" and "-R".

man find

Note that "ls -R" will list directories, but
"find [...] -type f [...]" will not.

"-exec ls -ld [...]" might obviate the
"-type f".

As usual, a precise problem description makes
it easier to provide a precise solution.
Steven Schweda
Honored Contributor

Re: list files in all subfolders

And, if you have file names with leading dots
(for example, ".fred"), then "find" won't
need any help to show those, but "ls" may.

man ls
Look for "-A".

Everything's complicated.
rariasn
Honored Contributor

Re: list files in all subfolders

Hi, D. Fernando:

find $DIRECTORY -type f -exec ll {} \; | awk '{ print $5, $6 , $7, $8, $1, $9 }'|sort -r -n |more

rgs,
S.N.S
Valued Contributor

Re: list files in all subfolders

Hi,

Go for ls -lR ...
It is less resourse intensive also...

HTH
SNS
"Genius is 1% inspiration, 99% Perspiration" - Edison
Dennis Handly
Acclaimed Contributor

Re: list files in all subfolders

>SNS: It is less resource intensive also.

Than find(1)? Of course if you are going to do find(1) then ll(1) there is a lot of duplication, so you're right.
Mike Miller_8
Regular Advisor

Re: list files in all subfolders

find . -exec ls -la {} \;
Daniel Leiva
Advisor

Re: list files in all subfolders

Sometimes the most simply solution is the best:
# ls -R

What did you mean "..with your permissions"?
There was a very poor man, so poor that all he had was money.
Fernando Boza
Regular Advisor

Re: list files in all subfolders

thanks
Steven Schweda
Honored Contributor

Re: list files in all subfolders

> find . -exec ls -la {} \;

And what does that do when it hits a
directory? And why "a" instead of "A"?
(Not enough useless info with "A"?)