*nix: find the largest files/directories within a directory

An article, posted more than 5 years ago filed in how i do it, unix, command line, terminal, sort, linux, macos & osx.

Every now and then I’m searching for this little snippet in my notes using NotationalVelocity (or currently actually a fork):

du -hsx * | sort -rh | head -100

It’s a variation of a snippet I found somewhere, but hardly invested any time in understanding what it actually does. Let’s decompose, from head to taildu.

head

head -100

head simply limits the results to a maximum of 100 lines. Not much more to explain here

sort

sort sorts. by default it sorts the files by filename, but adding ‘-h’ to it allows it to sort by “human readable numbers” (e.g. 5M > 6K); if ‘-n’ would be added as option 6K would be > 5M. The ‘-r’ options reverses the sort wich is by default ascending.

du

du by defaults crawls a directory recursively for all files. passing '-s' tells it to sum the values of files within directories. the '-x' option is used to n…

Continue reading...

iDuplicate.

An article, posted more than 12 years ago filed in mac, os, cloud, iphone, google, apple, soocial, osx, agenda, os-x, icloud, ios5, ipod, contacten, synchroniseren, adresboek & calender.

Het mooie aan dingen die digitaal zijn is dat zaken te kopiëren zijn. Kopiëren kon eerder natuurlijk ook wel, maar digitaal kan het zonder kwaliteitsverlies. Gegevens blijven doorzoekbaar, foto's verouderen niet, tekst blijft exact zoals het geschreven was (en bewerkbaar).

Exact dezelfde dingen op verschillende apparaten kunnen krijgen. Dat is gemakkelijk, want verjaardagen wil je ook wel eens weten wanneer je niet op de WC zit. En het is wel eens handig dat je in je telefoon ook de adres en e-mailgegevens hebt.

Ik heb het werkend gezien. Al jaren terug, in ieder geval in de eerste helft van de jaren nul, maar toen weigerde ik mijzelf over te leveren aan Outlook. En tot voor kort werkte het bij mij redelijk goed. Via iTunes kon ik goed mijn iPod in sync houden, ook qua adres en agenda gegevens, en tot de voorlaatste versie kwamen Apple machines met een iSync programma dat ook mijn niet-iPhone mooi in sync hield. Perfect. Lokaal. Geen gesleur van mijn gegevens via een zoveelste…

Continue reading...

murb blog