Skip to content

Instantly share code, notes, and snippets.

@jeremyjs
Created June 17, 2014 02:27
Show Gist options
  • Save jeremyjs/757412f872d9032626ca to your computer and use it in GitHub Desktop.
Save jeremyjs/757412f872d9032626ca to your computer and use it in GitHub Desktop.
# check current free space
$ df -h
Filesystem Size Used Avail Capacity iused ifree %iused Mounted on
/dev/disk0s2 233Gi 74Gi 158Gi 32% 19571865 41464807 32% /
devfs 221Ki 221Ki 0Bi 100% 767 0 100% /dev
map -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net
map auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home
/dev/disk1s2 8.0Mi 1.9Mi 6.1Mi 24% 481 1557 24% /Volumes/Adobe Reader Installer
/dev/disk2s2 3.7Mi 1.9Mi 1.9Mi 50% 477 480 50% /Volumes/SDL
/dev/disk3s2 11Mi 7.8Mi 2.9Mi 74% 1993 730 73% /Volumes/SDL2_mixer
/dev/disk4s2 4.4Mi 2.5Mi 1.9Mi 57% 634 490 56% /Volumes/SDL2_image
/dev/disk5s1 500Mi 209Mi 291Mi 42% 53398 74590 42% /Volumes/JDK 8 Update 05
/dev/disk6s1 984Ki 920Ki 64Ki 94% 228 16 93% /Volumes/Minecraft
/dev/disk7s2 24Mi 19Mi 4.9Mi 80% 4834 1260 79% /Volumes/Chromecast
# Space taken up by home directory and sub-directories
$ du -c -sh ./*
408K ./Applications
1.2G ./Code
520K ./Desktop
175M ./CodeDocuments
1.7G ./Downloads
5.9G ./Library
473M ./Minecraft
2.2G ./Movies
6.5M ./Music
16M ./Pictures
0B ./Public
19G ./VirtualBox VMs
44K ./backups
1.7M ./dot-files
41M ./dotfiles
0B ./jmeyer.txt
1.1G ./src
0B ./tmp
32G total
# running processes sorted by mem usage
$ top -o mem
Processes: 211 total, 2 running, 2 stuck, 207 sleeping, 1515 threads 17:01:18
Load Avg: 1.37, 1.82, 1.98 CPU usage: 3.9% user, 3.98% sys, 92.92% idle SharedLibs: 7856K resident, 8052K data, 0B linkedit. MemRegions: 69829 total, 1571M resident, 32M private, 370M shared.
PhysMem: 3514M used (1497M wired), 3567M unused. VM: 445G vsize, 1071M framework vsize, 13160453(0) swapins, 14324025(0) swapouts. Networks: packets: 27661125/18G in, 28756416/11G out.
Disks: 4488338/118G read, 5570011/160G written.
PID COMMAND %CPU TIME #TH #WQ #PORT #MREG MEM RPRVT PURG CMPRS VPRVT VSIZE PGRP PPID STATE UID FAULTS COW MSGSENT MSGRECV SYSBSD SYSMACH
0 kernel_task 5.0 04:51:08 103/8 0 2 2593 1095M- 63M 0B 0B 130M 12G- 0 0 running 0 835717 0 3048487338+ 2986967690+ 0 0
28549- Google Chrom 0.0 41:44.94 14 0 88 1054 188M 188M 0B 116M 484M 1207M 28528 28528 sleeping 502 4097009 1218 5111119 4123430 26889857 63922950
18677- Google Chrom 1.5 03:33.29 16 0 91 865 173M 172M 0B 128M 450M 1209M 28528 28528 sleeping 502 2261809 1302 35622+ 28416+ 1818465+ 658146+
28538- Google Chrom 2.4 79:13.81 27 0 118 2097 165M+ 165M+ 0B 782M- 1318M 2169M 28528 28528 sleeping 502 29458115+ 2881 1594998+ 880646+ 68349321+ 20125308+
28179- Google Chrom 0.3 01:30.29 14 0 98 797 96M+ 96M+ 0B 134M 353M 1140M 28528 28528 sleeping 502 1129816+ 1315 33193+ 19299+ 793894+ 479389+
28528- Google Chrom 1.3 02:23:45 45 1 586 4585 90M 64M 108K 155M 498M 1812M 28528 250 sleeping 502 27860292 921240 446195064+ 215518341+ 269480463+ 429060552+
204 WindowServer 6.8 02:57:07 4 0 528 7676 68M+ 23M 816K 223M- 275M 4259M- 204 1 sleeping 88 49645948+ 208238 377089635+ 177822620+ 12096827+ 276886826+
66750- Google Chrom 0.2 00:09.38 11 0 91 563 56M+ 55M+ 0B 55M 225M 1045M 28528 28528 sleeping 502 93643+ 1301 11201+ 6254+ 112161+ 127519+
52253- Google Chrom 0.0 17:03.63 11 0 88 500 54M 53M 0B 18M 201M 963M 28528 28528 sleeping 502 1977088 2188 1282423+ 79771+ 10376029 20401713+
67039- Google Chrom 0.2 00:06.95 11 0 91 552 43M+ 43M+ 0B 56M 211M 979M 28528 28528 sleeping 502 73731+ 1313 5926+ 2940+ 67079+ 68606+
35505 iTerm 5.3 14:21.84 10 2 249 1328 42M+ 21M+ 0B 46M 122M 2732M 35505 250 sleeping 502 3014099+ 62176 2380901+ 661548+ 12722327+ 9581121+
26301- Google Chrom 0.2 00:16.59 11 0 91 507 33M 32M 0B 36M 185M 951M 28528 28528 sleeping 502 219993 1304 11204+ 8321+ 114114+ 137273+
67077- Google Chrom 0.3 00:06.29 11 0 91 471 32M+ 32M+ 0B 25M 174M 960M 28528 28528 sleeping 502 55993+ 1304 10346+ 7553+ 81549+ 133450+
398- Spotify 0.7 51:22.58 41 1 2240 2464 32M 22M 0B 138M 359M 1301M 398 250 sleeping 502 5818729 8692 7850545+ 1171794 29290232+ 79739880+
28531- Google Chrom 0.0 29:19.35 5 0 84 1308 30M 13M 0B 132M 193M 1684M 28528 28528 sleeping 502 75736917 1176 18237126 6345223 34457560+ 6434143
3002- Google Chrom 0.2 00:23.91 11 0 82 460 27M+ 27M+ 0B 94M- 235M 971M 28528 28528 sleeping 502 285168+ 1306 8681+ 6472+ 170500+ 133080+
46807- Google Chrom 0.3 04:26.34 11 0 94 549 26M 25M 0B 66M 229M 994M 28528 28528 sleeping 502 989261 1279 120710+ 96283+ 786253+ 1800308+
26547- Google Chrom 0.1 00:12.64 11 0 91 460 23M+ 22M+ 0B 28M 168M 929M 28528 28528 sleeping 502 143413+ 1296 13010+ 9126+ 122848+ 153266+
892- Spotify Help 0.0 04:04.90 10 0 159 570 23M 22M 0B 71M 194M 930M 398 398 sleeping 502 5449972 869 740910 334488 2863069 4945197
28536- Google Chrom 0.4 05:32.53 11 0 94 630 22M+ 21M+ 0B 87M- 236M 1027M 28528 28528 sleeping 502 1907110+ 1315 274955+ 227544+ 2312464+ 4221344+
99714- Google Chrom 0.0 00:39.22 11 0 94 481 20M 20M 0B 21M 181M 952M 28528 28528 sleeping 502 316783 1308 51216+ 39451+ 807585+ 785917+
33529- Google Chrom 0.2 05:42.21 17 0 118 715 20M+ 20M+ 0B 174M 319M 1096M 28528 28528 sleeping 502 2498047+ 1278 196353+ 150623+ 1390339+ 2963966+
32254- Google Chrom 0.1 05:45.10 17 0 118 728 15M+ 15M+ 0B 165M 311M 1119M 28528 28528 sleeping 502 2940820+ 1305 204837+ 157996+ 1449391+ 3097024+
28541- Google Chrom 0.0 02:31.42 11 0 88 429 14M 14M 0B 10M 153M 940M 28528 28528 sleeping 502 1097688 1291 131902 77628 1786439 1825136
15961 top 11.1 05:08:30 1 0 49 62 13M 13M 0B 4392K 94M 2452M 15961 13973 sleeping 0 246206977+ 243 3770165365+ 1884570290+ 107976237+ 2298621135+
51365- Google Chrom 0.0 00:45.80 12 0 86 279 11M 10M 0B 16M 158M 884M 28528 28528 sleeping 502 411913 1278 52485 24398 906732 964521
26515- Google Chrom 0.0 00:05.32 11 0 91 422 11M 10M 0B 21M 150M 910M 28528 28528 sleeping 502 57072 1295 12711+ 7594+ 97811+ 165044+
60292- Google Chrom 0.1 00:27.82 11 0 94 490 10M 10M 0B 53M 174M 953M 28528 28528 sleeping 502 557698+ 1299 55986+ 28347+ 442774+ 905903+
93528 Finder 0.0 02:41.81 5 1 338 860 10M 8820K 0B 82M 196M 3880M 93528 250 sleeping 502 2769976 3777 884164 741519 5059012 4798023
27735- Google Chrom 0.2 00:08.25 11 0 91 490 10M+ 9388K+ 0B 48M- 171M 933M 28528 28528 sleeping 502 158580+ 1300 12888+ 6342+ 112488+ 191431+
53402- Google Chrom 0.1 00:36.74 11 0 91 493 9536K+ 8988K+ 0B 49M- 171M 931M 28528 28528 sleeping 502 327639+ 1306 65646+ 33614+ 523672+ 988965+
33504 iPhoto 0.2 06:20.35 24 5 356 964 9448K 7612K 0B 63M 310M 3130M 33504 250 sleeping 502 1107744 3216 270751 108042 8732352+ 12098170+
218 mds_stores 0.0 10:00.34 8 4 70 461 9008K 20M 148K 121M 511M 3263M 218 1 stuck 0 10497318+ 28873 977888+ 834205+ 23326268+ 5322147+
67588 mdworker 0.0 00:00.18 4 0 54 78 8816K 7884K 0B 0B 106M 2469M 67588 250 sleeping 502 4681 223 952 365 3585 1388
46112- Google Chrom 0.1 02:01.96 11 0 94 498 8596K 8056K 0B 32M 175M 940M 28528 28528 sleeping 502 784161+ 1296 253140+ 129641+ 1863914+ 4061017+
67022 mdworker 0.0 00:00.23 4 0 54 79 8240K 7560K 0B 900K 96M 2460M 67022 250 sleeping 502 5657 223 1466 508 6116 2353
66602- Google Chrom 0.0 00:03.38 11 0 91 444 7728K+ 8080K+ 0B 37M- 160M 925M 28528 28528 sleeping 502 49699+ 1291 5761+ 3105+ 51572+ 66555+
# after running a ruby while true do...end loop
# about half the cpu is consumed
$ htop -o cpu
Processes: 236 total, 5 running, 1 stuck, 230 sleeping, 1862 threads 21:25:31
Load Avg: 2.40, 2.47, 2.17 CPU usage: 28.40% user, 18.37% sys, 53.22% idle SharedLibs: 13M resident, 9616K data, 0B linkedit. MemRegions: 74177 total, 2249M resident, 53M private, 605M shared.
PhysMem: 4548M used (1403M wired), 2407M unused. VM: 494G vsize, 1067M framework vsize, 13904349(384) swapins, 14976688(0) swapouts. Networks: packets: 27681262/18G in, 28778049/11G out.
Disks: 4527238/121G read, 5609845/163G written.
PID COMMAND %CPU TIME #TH #WQ #PORT #MREG MEM RPRVT PURG CMPRS VPRVT VSIZE PGRP PPID STATE UID FAULTS COW MSGSENT MSGRECV SYSBSD SYSMACH CSW
35505 iTerm 148.3 28:08.90 11/1 3 239 1388 48M+ 27M+ 0B 34M- 124M 2733M 35505 250 running 502 3193657+ 64001 5070047+ 706036+ 89161313+ 31663377+ 9172060+
76686 ruby 74.6 07:09.47 2/1 0 17 56 12M 12M 0B 0B 41M 2410M 76686 76481 running 502 5540 606 118 53 731132616+ 310 2205509+
72 launchservic 43.9 04:16.12 67 66 419+ 202- 14M- 13M- 0B 68M- 162M- 2544M+ 72 1 sleeping 0 3106410+ 123 4352347+ 1393503+ 5998223+ 5475258+ 8051524+
402 Dock 21.3 03:49.65 5 2 265+ 1389+ 13M+ 12M+ 256K 41M- 111M+ 2722M+ 402 250 sleeping 502 4216543+ 607 3538037+ 3620879+ 7780950+ 5334396+ 4991691+
204 WindowServer 19.6 02:58:12 6 2 540+ 7833+ 72M+ 38M+ 13M 210M- 290M+ 4256M+ 204 1 sleeping 88 49926169+ 208240 378892906+ 178719533+ 12121805+ 278144869+ 66640282+
15961 top 15.8 05:13:50 1 0 49 62 13M 13M 0B 4240K 94M 2452M 15961 13973 sleeping 0 249980439+ 243 4154614338+ 2076780531+ 109619361+ 2497431976+ 820484+
77277 top 14.0 00:56.01 1/1 0 29- 47 4444K+ 4212K+ 0B 0B 81M 2439M 77277 77038 running 0 664348+ 89 65364072+ 32679666+ 289802+ 33827346+ 4380+
14 taskgated 6.2 00:46.92 4 1 41+ 61+ 4648K+ 4400K+ 0B 4092K- 98M+ 2480M+ 14 1 sleeping 0 996188+ 112 300122+ 90162+ 5902887+ 523495+ 183771+
51140- Google Chrom 5.6 14:25.72 18 0 98 470 23M+ 22M+ 0B 20M- 181M 942M 28528 28528 sleeping 502 319382+ 1296 246772+ 104370+ 17089087+ 2019445+ 9472417+
28528- Google Chrom 4.0 02:25:20 48 2 612- 4646- 112M+ 78M- 112K 102M 496M- 1827M- 28528 250 sleeping 502 28347084+ 938821 462588402+ 223678385+ 271387899+ 439225437+ 66979833+
0 kernel_task 3.2 04:52:45 103/8 0 2 2130+ 1047M+ 64M 0B 0B 130M 9231M+ 0 0 running 0 849499 0 3288363274+ 3226580215+ 0 0 1438123572+
67039- Google Chrom 3.0 00:17.80 11 0 94 563 52M+ 51M+ 0B 49M- 216M 982M 28528 28528 sleeping 502 107798+ 1314 13182+ 9208+ 124247+ 147928+ 39629+
28179- Google Chrom 2.3 01:47.89 14 0 101 797 119M+ 118M+ 0B 117M 361M 1142M 28528 28528 sleeping 502 1192660+ 1315 41906+ 24071+ 988504+ 615791+ 287035+
46807- Google Chrom 2.0 04:37.39 11/1 0 94 552 73M+ 72M+ 0B 9972K 218M 983M 28528 28528 running 502 1044363+ 1279 125137+ 99946+ 813353+ 1863580+ 367391+
254 distnoted 1.9 07:48.93 12 10 295+ 64- 9044K+ 8916K+ 0B 3448K 94M- 2482M- 254 250 sleeping 502 459026+ 98 279882+ 429242+ 10526525+ 610401+ 5977545+
76454 tccd 1.6 00:00.09 4 3 47+ 69+ 2932K+ 2212K+ 0B 0B 98M+ 2482M+ 76454 1 sleeping 0 1545+ 153 194+ 74+ 1484+ 360+ 320+
18677- Google Chrom 1.5 04:06.95 16 0 94 859 192M+ 191M+ 0B 107M 451M 1209M 28528 28528 sleeping 502 2347307+ 1302 41259+ 33230+ 2159125+ 759591+ 566190+
18 syslogd 1.2 01:19.37 8 7 130+ 61 1340K 1232K 0B 364K 102M 2469M 18 1 sleeping 0 582497+ 62 44439+ 18168+ 5981937+ 2355886+ 2296790+
65 hidd 1.1 20:12.07 4 1 103- 60- 1704K- 1392K- 0B 2892K 98M- 2456M- 65 1 sleeping 0 104778 123 41156018+ 18147739+ 10095898+ 31155796+ 12287181+
398- Spotify 1.1 51:47.33 43 2 2263 2481 53M+ 29M+ 0B 116M 362M 1302M 398 250 sleeping 502 5855736+ 8702 7889372+ 1175824+ 29544692+ 80621150+ 17994618+
28538- Google Chrom 0.9 79:56.49 27 0 118 2098 198M+ 198M+ 0B 749M 1317M 2164M 28528 28528 sleeping 502 29614211+ 2891 1605457+ 888919+ 68531141+ 20290728+ 28838098+
26301- Google Chrom 0.8 00:26.77 11 0 94 507 38M+ 37M+ 0B 30M- 185M 952M 28528 28528 sleeping 502 247212+ 1304 17103+ 13559+ 166382+ 204143+ 56446+
403 SystemUIServ 0.7 02:43.57 8 4 357- 592- 10M- 8676K- 44K 16M- 112M- 2619M- 403 250 sleeping 502 1188251+ 777 1840675+ 723110+ 3243131+ 6979098+ 3924367+
76427 ocspd 0.6 00:00.12 6 2 75 76 4384K 3688K 0B 0B 91M 2481M 76427 1 sleeping 0 2904+ 147 985+ 420 5058+ 2613+ 2052+
19 configd 0.6 01:27.58 20 14 386- 183- 2668K- 2272K- 0B 1308K 42M- 2465M- 19 1 sleeping 0 936651+ 14111 4318934+ 2193382+ 2446052+ 5849086+ 1208279+
77012 htop 0.6 00:02.03 1 0 20 41 1808K 1528K 0B 0B 49M 2415M 77012 66807 sleeping 502 54811+ 101 57405+ 3002+ 239886+ 83482+ 51975+
79 apsd 0.5 00:30.90 9 5 109 82 3164K+ 2788K+ 0B 1336K- 100M 2482M 79 1 sleeping 0 170552+ 222 212963+ 254749+ 1064158+ 1467737+ 739494+
60 loginwindow 0.5 02:31.63 4 2 348- 259- 4052K+ 3356K+ 0B 3900K- 86M- 2518M- 60 1 sleeping 502 682846+ 438 3524679+ 1877835+ 3140930+ 6931784+ 2324622+
66750- Google Chrom 0.5 00:20.54 11 0 94 563 61M+ 60M+ 0B 47M 225M 1046M 28528 28528 sleeping 502 128061+ 1301 16716+ 11284+ 169797+ 191188+ 53094+
36 coreservices 0.4 00:33.87 5 1 315+ 465+ 2484K+ 2136K+ 0B 6000K 70M+ 2490M+ 36 1 sleeping 0 423014+ 201416+ 1414901+ 609648+ 1243766+ 1905344+ 530566+
426 com.apple.do 0.4 00:25.94 5 2 146+ 149+ 2252K+ 1912K+ 0B 2572K- 99M+ 2506M+ 426 1 sleeping 502 278133+ 558 358147+ 70808+ 844195+ 786501+ 823683+
52253- Google Chrom 0.4 17:09.78 11 0 88 504 57M 56M 0B 12M 206M 969M 28528 28528 sleeping 502 2013434+ 2200 1286045+ 81271+ 10404164+ 20453999+ 3425923+
33504 iPhoto 0.3 06:27.61 23 4 353- 962- 11M+ 8852K 0B 61M 309M- 3129M- 33504 250 sleeping 502 1113716+ 3233 275566+ 110155 8909082+ 12356219+ 5369289+
18682- Google Chrom 0.3 00:00.89 7 1 135 167 1852K+ 1312K+ 0B 7012K- 104M 813M 28528 28528 sleeping 502 20730+ 1162 10663+ 3138 29965+ 21308+ 22643+
67077- Google Chrom 0.3 00:15.45 11 0 94 472 28M+ 27M+ 0B 21M 174M 960M 28528 28528 sleeping 502 76884+ 1305 15945+ 12654+ 139087+ 198231+ 44179+
412 Notification 0.3 00:40.28 4 1 175+ 297 4732K+ 3832K+ 0B 7608K- 91M 2546M 412 250 sleeping 502 402797+ 547 529037+ 172988+ 1055800+ 1274119+ 1031081+
71050- Google Chrom 0.3 00:06.37 11 0 94 471 31M+ 30M+ 0B 0B 178M 964M 28528 28528 sleeping 502 65985+ 1297 4806+ 3874+ 48418+ 52718+ 16950+
555 RecordIt 0.3 00:50.30 14 2 197 439 3984K+ 3380K+ 0B 10M- 104M 3582M 555 250 sleeping 502 344112+ 522 630442+ 382951+ 1976043+ 2245366+ 1796317+
52334- Spotify Help 0.3 00:37.67 11 1 157 390 65M+ 64M+ 0B 17M 204M 920M 398 398 sleeping 502 796720+ 858 79722+ 33852 356826+ 381746+ 172065+
27749 Xcode 0.3 01:02.13 9 2 305- 763- 7112K+ 5912K+ 0B 60M- 115M- 3756M- 27749 250 sleeping 502 111135+ 4357 866659+ 367818+ 4693872+ 3724132+ 1977020+
32748- GoogleTalkPl 0.3 00:09.57 10 1 197- 198- 2112K+ 1656K+ 0B 6336K- 125M- 791M- 32748 250 sleeping 502 23925+ 734 15179+ 6284+ 432419+ 96844+ 237731+
399 Preview 0.3 03:13.88 16 2 327 1659 7348K+ 4788K+ 0B 149M 474M 4258M 399 250 sleeping 502 3596884+ 5648 1133843+ 475540 1700126+ 8245515+ 2649373+
566 TotalFinder 0.3 00:42.52 5 2 133 110 2908K+ 2544K+ 0B 5128K- 106M 2517M 566 250 sleeping 502 309503+ 247 478732+ 280862+ 1301590+ 1977864+ 1314175+
891- Spotify Help 0.3 02:39.70 11 1 154 230 2500K+ 1956K+ 0B 15M 134M 831M 398 398 sleeping 502 291968+ 828 1595092+ 897929+ 1367295+ 11147956+ 1324127+
564 Alfred 2 0.3 01:03.34 6 1 208 298 3888K+ 3252K+ 0B 14M 117M 2570M 564 250 sleeping 502 632400+ 592 754934+ 253744+ 1428859+ 2309032+ 1298218+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment