Hello Folks,
I want to generate the file attributes of the system and needs to write into the text file.
I am running the command "ls -Rl" to get the details of the files from the current directory.
I am getting the output.
./linux-2.6.29.4/arch:
total 10
drwxr-xr-x 9 1138 5000 328 May 18 16:52 alpha
drwxr-xr-x 68 1138 5000 2104 May 18 16:52 arm
drwxr-xr-x 11 1138 5000 352 May 18 16:52 avr32
drwxr-xr-x 17 1138 5000 552 May 18 16:52 blackfin
drwxr-xr-x 8 1138 5000 272 May 18 16:52 cris
drwxr-xr-x 7 1138 5000 288 May 18 16:52 frv
drwxr-xr-x 8 1138 5000 392 May 18 16:52 h8300
drwxr-xr-x 17 1138 5000 552 May 18 16:52 ia64
-rw-r--r-- 1 1138 5000 3022 May 18 16:52 Kconfig
drwxr-xr-x 9 1138 5000 304 May 18 16:52 m32r
drwxr-xr-x 22 1138 5000 608 May 18 16:52 m68k
drwxr-xr-x 7 1138 5000 280 May 18 16:52 m68knommu
drwxr-xr-x 35 1138 5000 944 May 18 16:52 mips
drwxr-xr-x 11 1138 5000 368 May 18 16:52 mn10300
drwxr-xr-x 10 1138 5000 408 May 18 16:52 parisc
drwxr-xr-x 14 1138 5000 424 May 18 16:52 powerpc
drwxr-xr-x 13 1138 5000 424 May 18 16:52 s390
drwxr-xr-x 15 1138 5000 472 May 18 16:52 sh
drwxr-xr-x 11 1138 5000 344 May 18 16:52 sparc
drwxr-xr-x 11 1138 5000 752 May 18 16:52 um
drwxr-xr-x 23 1138 5000 728 May 18 16:52 x86
drwxr-xr-x 10 1138 5000 328 May 18 16:52 xtensa
./linux-2.6.29.4/arch/alpha:
total 52
drwxr-xr-x 3 1138 5000 248 May 18 16:52 boot
-rw-r--r-- 1 1138 5000 20414 May 18 16:52 defconfig
drwxr-xr-x 3 1138 5000 72 May 18 16:52 include
-rw-r--r-- 1 1138 5000 19491 May 18 16:52 Kconfig
-rw-r--r-- 1 1138 5000 1355 May 18 16:52 Kconfig.debug
drwxr-xr-x 2 1138 5000 2384 May 18 16:52 kernel
drwxr-xr-x 2 1138 5000 1688 May 18 16:52 lib
-rw-r--r-- 1 1138 5000 2258 May 18 16:52 Makefile
drwxr-xr-x 2 1138 5000 152 May 18 16:52 math-emu
drwxr-xr-x 2 1138 5000 176 May 18 16:52 mm
drwxr-xr-x 2 1138 5000 256 May 18 16:52 oprofile
I want the output through the script that converts the output in the below mentioned format
I want the output in such a way, each file shows the full path from the "/" directory.
total 10
drwxr-xr-x 9 1138 5000 328 May 18 16:52 /usr/src/kernels/linux-2.6.29.4/archalpha
drwxr-xr-x 68 1138 5000 2104 May 18 16:52 /usr/src/kernels/linux-2.6.29.4/archarm
drwxr-xr-x 11 1138 5000 352 May 18 16:52 /usr/src/kernels/linux-2.6.29.4/archavr32
I have tried many sed regex but I did not make it work.
Could you please help me out to write this script?
Thanks,
Saurabh