From: Ben Bacarisse on 27 May 2010 10:36 Janis Papanagnou <janis_papanagnou(a)hotmail.com> writes: > rvaede wrote: <snip> >> How can I check for subdirectories thats my issue? > > du(1) will show you the directories only, not ordinary files and such. My du does both: $ ls -ld 2006* drwxr-xr-x 2 ben ben 4096 May 27 15:33 2006-dir -rw-r--r-- 1 ben ben 4 May 27 15:32 2006-file $ du -hc 2006* 12K 2006-dir 4.0K 2006-file 16K total > But originally you wrote you want to check files and not directories. > Your ls -al 2006* should already show the sizes the file require. > Maybe you want to add the sizes yourself, using > > ls -al 2006* | awk '{s+=$5} END{print s}' > > If not, it may help if you re-phrase your question (and/or provide some > samples that show what you want to obtain). I'd happy with a explanation of why du 2006* is not what is wanted (as I asked some while ago). -- Ben.
From: Michael Paoli on 29 May 2010 10:29
On May 26, 9:12 am, rvaede <rvaedex23(a)gmail.com> wrote: > If I do an ls -al 2006* in a directory how can I find the size of > these files? > I am having trouble combining the two using the du command Logical, or physical size? $ pwd -P; df -k . /tmp/usenet Filesystem 1K-blocks Used Available Use% Mounted on tmpfs 257792 16 257776 1% /tmp $ dd bs=1048576 seek=1024 count=0 of=1 0+0 records in 0+0 records out 0 bytes transferred in 0.000255 seconds (0 bytes/sec) $ n=2; while [ $n -le 9 ]; do ln 1 $n; n=`expr $n + 1`; done; unset n $ df -k . Filesystem 1K-blocks Used Available Use% Mounted on tmpfs 257792 16 257776 1% /tmp $ ls -ons * 0 -rw------- 9 1003 1073741824 May 29 07:20 1 0 -rw------- 9 1003 1073741824 May 29 07:20 2 0 -rw------- 9 1003 1073741824 May 29 07:20 3 0 -rw------- 9 1003 1073741824 May 29 07:20 4 0 -rw------- 9 1003 1073741824 May 29 07:20 5 0 -rw------- 9 1003 1073741824 May 29 07:20 6 0 -rw------- 9 1003 1073741824 May 29 07:20 7 0 -rw------- 9 1003 1073741824 May 29 07:20 8 0 -rw------- 9 1003 1073741824 May 29 07:20 9 $ du -s . 0 . $ |