P at draigBrady.com wrote:
>P at draigBrady.com wrote:
>>>>> l() { cols=$1; width=`expr $cols '*' 40`; /bin/ls -F | pr -T$cols \
>> -W$width; }
>>>> To display 1 column listing you issue "l 1" and for 4 columns "l 4"
>>> Oops you probably want to add the -a option to pr above
> so that the columns print across rather than down.
Also the following script would list one line
per letter, which may be easier to navigate?
#!/usr/bin/python
import os
letters={}
for path in os.popen("ls -F").readlines():
path=path.strip()
letters.setdefault(path[0].lower(),[]).append(path)
for letter in letters:
for path in letters[letter]:
print "%-38s"%path[0:39],
print
--
Pádraig Brady - http://www.pixelbeat.org
--
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!