Quick question: Finding directory content size in Telnet

Unsickle

Golden Member
Feb 1, 2000
1,016
0
0
Is there a command to find the complete directory size in a Telnet session?

aka find the size of the contents of my "www" folder or whatever.
 

Electrode

Diamond Member
May 4, 2001
6,063
2
81
I assume you're using a remote bash shell. Use ls -la | less and add up the file sizes.

I think there is an easier way, but I can't think of it off hand.
 

kt

Diamond Member
Apr 1, 2000
6,032
1,348
136
what are you telnetting into? Linux server or ?
 

Electrode

Diamond Member
May 4, 2001
6,063
2
81


<< du >>

Never heard of that before, but I just looked for a manpage, and sure enough!

DU
Section: User Commands (1)
NAME
du - estimate file space usage
SYNOPSIS
du [options] [file...]

POSIX options: [-askx] [--]

GNU options (shortest form): [-abcDhHklLmsSxX] [--block-size=size] [--exclude=pattern] [--max-depth=n] [--help] [--version] [--]
DESCRIPTION
du reports the amount of disk space used by the specified files, and by each directory in the hierarchies rooted at the specified files. Here `disk space used' means space used for the entire file hierarchy below the specified file.

With no arguments, du reports the disk space for the current directory.
(...)
 

Nemesis77

Diamond Member
Jun 21, 2001
7,329
0
0
nobody should use Telnet for ANYTHING anymore! It's just one massive security-hole! I don't use it even for my internal network. use SSH instead.
 

Buddha Bart

Diamond Member
Oct 11, 1999
3,064
0
0
"du -sh"

-s makes it a 'summary' (not sure if thats what the "s" stands for, but it just gives the total number)
-h makes it 'human' readable (aka in Meg, not K)

bart