🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #4574

Re: du How does du work?

#4574
From: Andrew Gierth
Date: Fri, 08 Nov 1996 00:00
23 lines
1967 bytes
>>>>> "lbliao" == lbliao  <lbliao@alumnae.caltech.edu> writes:

 lbliao> How does du work? How does it descend down the filesystem and
 lbliao> get the name of each file? Is there a command that can
 lbliao> recursively descend the file system and give the name of the
 lbliao> file to do something to? The other option of piping or
 lbliao> storing may be RAM or harddisk intensive.

Read all about it; source for du is easily available (e.g. GNU fileutils,
or from ftp.freebsd.org).

There is a command to recursively descend the filesystem: 'find'.

In a program, you may have a library function ftw().

At a lower level, you can easily search the directory tree yourself using
opendir/readdir/closedir, stat(), etc.

-- 
Andrew Gierth (andrewg@microlise.co.uk)

"Ceterum censeo Microsoftam delendam esse" - Alain Knaff in nanam
Technical Details
Message-ID: <ufloccn0je.fsf@zen.microlise.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <55u79a$n5o@gap.cco.caltech.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f8c9b,8c44339d2a70be4e
X-Google-Attributes: gidf8c9b,public
X-Google-Thread: fc89c,8c44339d2a70be4e
X-Google-Attributes: gidfc89c,public
X-Google-Thread: 1012a6,8c44339d2a70be4e
X-Google-Attributes: gid1012a6,public
X-Google-Thread: 1025b4,8c44339d2a70be4e
X-Google-Attributes: gid1025b4,public
X-Google-Thread: f72b0,8c44339d2a70be4e
X-Google-Attributes: gidf72b0,public
From: andrewg@microlise.co.uk (Andrew Gierth)
Subject: Re: du How does du work?
Date: 1996/11/08
Message-ID: <ufloccn0je.fsf@zen.microlise.co.uk>
X-Deja-AN: 195292359
x-geek: (V3.1)
x-nntp-posting-host: microl.demon.co.uk
references: <55u79a$n5o@gap.cco.caltech.edu>
cc: lbliao  <lbliao@alumnae.caltech.edu>
x-mayan-date: Long count = 12.19.3.11.11; tzolkin = 4 Chuen; haab = 14 Zac
followup-to: comp.unix.programmer
organization: Microlise Engineering Ltd.
 gcs/it/cc d-(pu) s: +> a- C++++$ UACHV++++$ P--- L E++ W(--) N+++ o? K? w---
x-attribution: AG
newsgroups: comp.unix.shell,comp.unix.programmer,comp.unix.questions,comp.unix.misc,gnu.misc.discuss