[Gllug] Job Advert

Nix nix at esperi.org.uk
Fri Feb 9 01:58:54 UTC 2007


On 8 Feb 2007, Juergen Schinker outgrape:
> Am Do, 8.02.2007, 14:10, schrieb Iain Gray:
>> 2. How do you find out the capacity and percentage in use of all
>> filesystems mounted?
>
> df -h

Nonportable. I have 'df -Pk' hardwired into my brain because without -k
most proprietary Unixes will display sizes in the ridiculous
POSIX-mandated 512-byte blocks (GNU df only does this if
POSIX_ME_HARDER, sorry, that should be POSIXLY_CORRECT, is set), and
without -P most will produce output in some vile bizarre layout that's
much harder to parse than the columnar POSIX layout. (Sometimes they
don't actually mention the amount of free space in that output, which
is you'd think a rather important thing for df(1) output to contain.)

>> 3. How do you find out the disk usage of a directory?
>
> du -hx --max-depth=1

The problem is that this a really ambiguous question (your answer is
nonportable but will work, as long as subdirectories are not wanted). I
could equally well have answered

ls -ld | cut -d\  -f 5

or (nonportable, with the same effect but no dependence on the number or
ordering of fields in ls output)

find . -maxdepth 0 -printf '%s\n'

> but i got an question for you as well :
>
> how do you mount (from Linux) a root of a DFS(Microsoft)?

Pass, I don't do Microsoft. (I'm not even sure how to expand the DFS
acronym, this being MS it probably means something strange; if it's
Distributed File System then you use mount(8) and/or smbmount(8)...)

-- 
`In the future, company names will be a 32-character hex string.'
  --- Bruce Schneier on the shortage of company names
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list