]> git.nbdom.net Git - nb.git/commitdiff
free for mac
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 3 Oct 2016 21:56:28 +0000 (22:56 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 3 Oct 2016 21:56:28 +0000 (22:56 +0100)
etc/profile.d/mac.sh

index 587b945ec7603697a918cb3f98f76c1f4211914e..a48458148c145adbdc3c5b8ba195d1068f1cd671 100644 (file)
@@ -42,6 +42,10 @@ alias macps_top="echo 'TOP PROCESSES:'; ps -Aro'%cpu, ucomm, user' | grep $USER
 alias mac_vlc_playlists="open -a vlc --args /home/nico/Music/*/*.m3u"
 alias mac_mount_nfs="sudo mount -o resvport -t nfs"
 
+free() {
+  vm_stat | perl -ne '/page size of (\d+)/ and $size=$1; /Pages\s+([^:]+)[^\d]+(\d+)/ and printf("%-23s: %10.2f Mo\n",$1, $2 * $size / 1048576);'
+}
+
 mac_config() {
   declare run r; run="
 echo 'Finder path           : YES'