summaryrefslogtreecommitdiffstats
path: root/usr.bin/du
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1994-08-10 19:25:34 +0000
committerwollman <wollman@FreeBSD.org>1994-08-10 19:25:34 +0000
commit4133bd443ab38bbba0798034711c5ef976303226 (patch)
treec6c39d992619d5364c5ecca91a49bb919d5def5a /usr.bin/du
parent670a01d488cd426b06ef3810ef072b61f698dfba (diff)
downloadFreeBSD-src-4133bd443ab38bbba0798034711c5ef976303226.zip
FreeBSD-src-4133bd443ab38bbba0798034711c5ef976303226.tar.gz
Gimme my `-k' option back!
Diffstat (limited to 'usr.bin/du')
-rw-r--r--usr.bin/du/du.15
-rw-r--r--usr.bin/du/du.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/du/du.1 b/usr.bin/du/du.1
index 4ecce8e..97c366a 100644
--- a/usr.bin/du/du.1
+++ b/usr.bin/du/du.1
@@ -67,6 +67,11 @@ All symbolic links are followed.
No symbolic links are followed.
.It Fl a
Display an entry for each file in the file hierarchy.
+.It Fl k
+Report in 1024-byte (1-Kbyte) blocks rather than the default. Note that
+this overrides the
+.Ev BLOCKSIZE
+setting from the environment.
.It Fl s
Display only the grand total for the specified files.
.It Fl x
diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c
index 48869de..49b5f9b 100644
--- a/usr.bin/du/du.c
+++ b/usr.bin/du/du.c
@@ -73,7 +73,7 @@ main(argc, argv)
save = argv;
Hflag = Lflag = Pflag = aflag = sflag = 0;
ftsoptions = FTS_PHYSICAL;
- while ((ch = getopt(argc, argv, "HLPasx")) != EOF)
+ while ((ch = getopt(argc, argv, "HLPaksx")) != EOF)
switch (ch) {
case 'H':
Hflag = 1;
@@ -90,6 +90,9 @@ main(argc, argv)
case 'a':
aflag = 1;
break;
+ case 'k':
+ putenv("BLOCKSIZE=1024");
+ break;
case 's':
sflag = 1;
break;
@@ -224,6 +227,6 @@ usage()
{
(void)fprintf(stderr,
- "usage: du [-H | -L | -P] [-a | -s] [-x] [file ...]\n");
+ "usage: du [-H | -L | -P] [-a | -s] [-k] [-x] [file ...]\n");
exit(1);
}
OpenPOWER on IntegriCloud