Kodama's home / tips.

Convert ls-lR to full path names

Download: lR2fullpath.rb

This script convert ls -lR file to full path names.

Example

$ ls -lR /usr/X11R6
/usr/X11R6:
total 20
drwxr-xr-x    2 root     root         4096  7月 23日 1999年 bin/
drwxr-xr-x   12 root     root         4096  8月 11日 2002年 include/
drwxr-xr-x    5 root     root         4096  7月 23日 1999年 lib/
drwxr-xr-x   13 root     root         4096  8月 11日 2002年 man/
drwxr-xr-x    4 root     root         4096  8月 11日 2002年 share/

/usr/X11R6/bin:
total 25304
-rwxr-xr-x    1 root     root       182556  8月 11日 2002年 DNDDemo*
lrwxrwxrwx    1 root     root            7 12月 15日 2002年 X -> XFree86*
-r-xr-xr-x    1 root     root          213  9月 16日 2000年 XConsole*
-rws--x--x    1 root     root      1788869  6月  8日 2002年 XFree86*
-rwxr-xr-x    1 root     root        27494  6月  8日 2002年 Xmark*
.....snip.....
$ ls -lR /usr/X11R6 | lR2fullpath.rb
/usr/X11R6/bin/DNDDemo
/usr/X11R6/bin/XConsole
/usr/X11R6/bin/XFree86
/usr/X11R6/bin/Xmark
.....snip.....
In this example, we get only normal files. (i.e. Directories and links are eliminated.) We can control this behavior. See the script for more details.

Note

You may use a command "find"(1) instead of the "ls -lR" when scan files recursively.
Kodama's home / tips.