To read directories and file

Hi ;
I want to write a shell script to read all files and directories(recursively) given in path along with their user permissions and store that result in one file as
File path Userpermissions
===== ===========

I m new to linux and my dont kno much abt shell scripting.
I will appreciate if nebody help me out in getting through this.

Thanks;
Ajay

How about this ?

 find . | xargs ls -l | awk '!/^\./ && !/^total/ && !/^$/{print $1,$NF}'
echo "File######User#####Permission" >File.txt;
echo "===============================================" >>File.txt;
ls -ltr | awk -F' ' '{if($1 == "total" ){}else{print $8"####"$1"####"$3;}}' >>File.txt

Cheers,
Ranga:)

Hi;
thanks for the reply.
I have one problem though.For those files having spaces in their filename,commands are not working properly.
Is der any proper way by which one can do this formating using awk to accept filename containing spaces too in listing.
Thnks again,

 
find . -type f -ls | nawk '{for(i=11;i<=NF;i++){printf("%s ",$i)} {print $3}}'

Thank u for all buddies..:slight_smile: