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
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 .
(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
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 ".",
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
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:
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
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 {} \; |
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
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
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
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.
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...
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
14 matches
Mail list logo