Re: dir command

2007-07-30 Thread Jochen Schulz
William Pursell: > > To get sizes, du is the obvious choice, but you > could do the ridiculous: > $ find . -type f -exec cat {} \; | wc -c Note that this is different from du in that it counts characters, not bytes. In some encodings a character may be larger than one byte, so your result would b

Re: dir command

2007-07-30 Thread Sjoerd Hardeman
pinniped schreef: (quote) To get sizes, du is the obvious choice, but you could do the ridiculous: $ find . -type f -exec cat {} \; | wc -c (end quote) I do the slightly less ridiculous: for X in $(find . -name '*'); do du -b $X >> mylogfile; done Which still uses du. One could also do find .

dir command

2007-07-30 Thread pinniped
(quote) To get sizes, du is the obvious choice, but you could do the ridiculous: $ find . -type f -exec cat {} \; | wc -c (end quote) I do the slightly less ridiculous: for X in $(find . -name '*'); do du -b $X >> mylogfile; done -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of

Re: dir command

2007-07-30 Thread Jörg-Volker Peetz
How about this? ls -lRA | awk '/^[cdlps-]/ {b += $5; f += 1} \ END {print b " bytes in " f " files"}' or find . -ls | awk '{b += $7; f += 1} \ END {print b " bytes in " f " files"}' But they doesn't count the inodes and the first command doesn't count the ".",

Re: dir command

2007-07-26 Thread Agricolae Maximus
Ron Johnson([EMAIL PROTECTED]) is reported to have said: > On 07/15/07 09:50, Manon Metten wrote: > > Hi, > > > > Is there a bash command available that shows the contents of the > > given dir recursively, telling me how many files are in there and > > the byte size occupied? <> > He

Re: dir command

2007-07-19 Thread Bob Proulx
William Pursell wrote: > To get sizes, du is the obvious choice, but you > could do the ridiculous: > $ find . -type f -exec cat {} \; | wc -c Since that performs a lot of disk I/O reading every byte of every file I would much prefer using stat for this. find . -type f -exec stat --format="%n:

Re: dir command

2007-07-16 Thread Manon Metten
Hi Ron, On 7/15/07, Ron Johnson <[EMAIL PROTECTED]> wrote: The top of the file shows various command-line options that I've found useful over the years. Mostly borrowed from the OpenVMS DIR command. Thanks again. I don't know nothing about python, so if you hadn

Re: dir command

2007-07-16 Thread Manon Metten
Hi William, On 7/15/07, William Pursell <[EMAIL PROTECTED]> wrote: For the total number of files: $ find . -type f | wc -l For the total number of directories: $ find . -type d | wc -l To get sizes, du is the obvious choice, but you could do the ridiculous: $ find . -type f -exec cat {} \; |

Re: dir command

2007-07-16 Thread Wayne Topa
Ron Johnson([EMAIL PROTECTED]) is reported to have said: > On 07/15/07 09:50, Manon Metten wrote: > >Hi, > > > >Is there a bash command available that shows the contents of the given dir > >recursively, telling me how many files are in there and the byte size > >occupied? <> > > This is what I

Re: dir command

2007-07-15 Thread Ron Johnson
shows various command-line options that I've found useful over the years. Mostly borrowed from the OpenVMS DIR command. -- Ron Johnson, Jr. Jefferson LA USA Give a man a fish, and he eats for a day. Hit him with a fish, and he goes away for good! -- To UNSUBSCRIBE, email to [EMAIL PROTE

Re: dir command

2007-07-15 Thread William Pursell
Manon Metten wrote: Is there a bash command available that shows the contents of the given dir recursively, telling me how many files are in there and the byte size occupied? For the total number of files: $ find . -type f | wc -l For the total number of directories: $ find . -type d | wc

Re: dir command

2007-07-15 Thread Manon Metten
Hi Ron, On 7/15/07, Ron Johnson <[EMAIL PROTECTED]> wrote: This is what I wrote to solve a similar problem: http://members.cox.net/ron.l.johnson/pydir Wow, thanks Ron! Works great. Just what I needed. Greetings, Manon.

Re: dir command

2007-07-15 Thread Ron Johnson
On 07/15/07 09:50, Manon Metten wrote: Hi, Is there a bash command available that shows the contents of the given dir recursively, telling me how many files are in there and the byte size occupied? On my old Amiga I have Sizer. It does something like this: :> Sizer FOX:1960 sizing quietly...

dir command

2007-07-15 Thread Manon Metten
Hi, Is there a bash command available that shows the contents of the given dir recursively, telling me how many files are in there and the byte size occupied? On my old Amiga I have Sizer. It does something like this: :> Sizer FOX:1960 sizing quietly... FOX:1960... Total number of files