Xref: utzoo comp.unix.ultrix:2038 comp.unix.questions:17221 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!purdue!haven!umbc3!rostamia From: rostamia@umbc3.UMBC.EDU (Rouben Rostamian) Newsgroups: comp.unix.ultrix,comp.unix.questions Subject: Can ls show total Kbytes of "foo*"? Message-ID: <2453@umbc3.UMBC.EDU> Date: 26 Oct 89 22:26:06 GMT Organization: Univ of Maryland Baltimore County Lines: 25 I wonder if there is an obvious way to compute the total size of all "foo*" files in a directory. The only way I know how is the ridiculously complicated construction: ls -1s foo* | awk 'BEGIN{size=0} {size += $1} END{print "total: " size}' (which I alias to something.) I run ULTRIX. The command "ls -s" in ULTRIX lists the files in the current directory, gives the size of each file in kilobytes, and also gives the total kilobytes for the files in that directory. It stands to reason to expect that the command "ls -s foo*" would provide the corresponding information for all files "foo*" in the directory. Alas, it does not work that way; although the size of each "foo*" is displayed, the total kilobytes for the "foo*" files is not. Am I missing something obvious? -- Rouben Rostamian Phone: 301 455-2458 Department of Mathematics e-mail: University of Maryland Baltimore County rostamian@umbc.bitnet Baltimore, MD 21228 rostamian@umbc3.umbc.edu