Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cas cas$ df
- Filesystem 512-blocks Used Avail Capacity Mounted on
- /dev/disk0s3 58342896 49924456 7906440 86% /
- devfs 194 194 0 100% /dev
- fdesc 2 2 0 100% /dev
- <volfs> 1024 1024 0 100% /.vol
- automount -nsl [166] 0 0 0 100% /Network
- automount -fstab [170] 0 0 0 100% /automount/Servers
- automount -static [170] 0 0 0 100% /automount/static
- /dev/disk2s1 163577856 23225520 140352336 14% /Volumes/Snapshot
- /dev/disk2s2 409404102 5745938 383187960 1% /Volumes/Sparse
- cas cas$ mount
- /dev/disk0s3 on / (local, journaled)
- devfs on /dev (local)
- fdesc on /dev (union)
- <volfs> on /.vol
- automount -nsl [166] on /Network (automounted)
- automount -fstab [170] on /automount/Servers (automounted)
- automount -static [170] on /automount/static (automounted)
- /dev/disk2s1 on /Volumes/Snapshot (local, nodev, nosuid, journaled)
- /dev/disk2s2 on /Volumes/Sparse (asynchronous, local, nodev, nosuid)
- cas cas$ df | grep -e/
- | awk '{print $NF}'
- | while read line; do echo $line $(stat -f"%Sdr" $line); done
- / disk0s3r
- /dev ???r
- /dev ???r
- /.vol ???r
- /Network ???r
- /automount/Servers ???r
- /automount/static ???r
- /Volumes/Snapshot disk2s1r
- /Volumes/Sparse disk2s2r
- d
- df | grep -e/ | awk '{print $NF}' | while read line; do echo "$line" "$(stat -f%Sd "$line"); done
- df | tail +2 | awk '{print $NF}' | xargs stat -f'%N %Sd %d'
- df | tail +2 | awk '{print $NF}' | xargs stat -f'%N %Sd %d' |
- awk 'BEGIN{f=2^24} {$(NF+1) = int($NF/f) "," ($NF%f) } 1'
- mountz | xargs -0 stat -f'%N %Sd %d' |
- awk 'BEGIN{f=2^24} {$(NF+1) = int($NF/f) "," ($NF%f) } 1'
- #include <sys/mount.h>
- #include <stdio.h>
- #include <stdlib.h>
- /* usage: mountz | xargs -0 command_for_each_mount_point */
- int main(int argc, const char *argv[]) {
- struct statfs *buf;
- int flags = MNT_NOWAIT, num_fs, num_stat, i;
- unsigned bufsz;
- num_fs = getfsstat(NULL, 0, flags);
- if (num_fs < 0) {
- perror("unable to count mounted filesystems: getfsstat");
- exit(1);
- }
- bufsz = sizeof(*buf) * num_fs;
- buf = malloc(bufsz);
- if (!buf) {
- perror("unable to allocate %u statfs structs");
- exit(1);
- }
- fprintf(stderr, "p=%pn", buf);
- num_stat = getfsstat(buf, bufsz, flags);
- if (num_stat < 0) {
- perror("unable to getfsstat");
- exit(1);
- }
- if (num_stat != num_fs) {
- fprintf(stderr, "Hmm, expected %u, got %d.n", num_fs, num_stat);
- }
- for (i = 0; i < num_stat; i++) {
- fprintf(stdout, "%s%c", buf[i].f_mntonname, 0);
- }
- }
- df | grep -e/ | awk '{print $NF}' | while read line; do echo $line $(stat -f"%Sd" $line); done
- / disk0s2
- /dev XGS bin tmp
- /net XGS bin tmp
- /home XGS bin tmp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement