{"id":30333,"date":"2014-05-14T10:24:45","date_gmt":"2014-05-14T15:24:45","guid":{"rendered":"http:\/\/webirix.com\/?p=30333"},"modified":"2014-05-14T10:35:54","modified_gmt":"2014-05-14T15:35:54","slug":"busca-los-directorios-o-archivos-mas-grande-de-tu-disco-duro-con-find","status":"publish","type":"post","link":"https:\/\/webirix.com\/en\/busca-los-directorios-o-archivos-mas-grande-de-tu-disco-duro-con-find\/","title":{"rendered":"Search the largest directories or files on your hard drive with find"},"content":{"rendered":"<h2 class=\"title-single\" style=\"font-weight: lighter; color: #0088cc;\">\u00bfNo han deseado alguna vez saber cu\u00e1l es la carpeta o el archivo m\u00e1s grande que tienen en su disco duro?<\/h2>\n<p style=\"color: #333333;\">El comando\u00a0<strong>find<\/strong> es genial, nos permite hacer muchas cosas (de algunas ya hemos hablado ac\u00e1), aqu\u00ed les traigo otra utilidad de \u00e9l.<\/p>\n<p style=\"color: #333333;\">El siguiente comando buscar\u00e1 en todo el HDD y nos dir\u00e1 cu\u00e1les son los 10 archivos o carpetas m\u00e1s grandes del ordenador:<\/p>\n<p style=\"color: #333333;\"><strong>sudo find \/ -printf &#8216;%s %p\\n&#8217;| sort -nr | head -10<\/strong><\/p>\n<p style=\"color: #333333;\">Si desean saber no solo los 10 m\u00e1s grandes, sino los 20 o algo as\u00ed, simplemente cambien el \u00faltimo n\u00famero 10 por el deseado.<\/p>\n<p style=\"color: #333333;\">Como dije antes, esto contar\u00e1 tanto carpetas como archivos, si desean solamente tener en cuenta las\u00a0<strong>carpetas<\/strong>\u00a0ser\u00eda agregar -type d (d = directorio):<\/p>\n<p style=\"color: #333333;\"><strong>sudo find \/ -type d -printf &#8216;%s %p\\n&#8217;| sort -nr | head -10<\/strong><\/p>\n<p style=\"color: #333333;\">Por el contrario y desean ver solo los\u00a0<strong>archivos<\/strong>\u00a0y no las carpetas ser\u00eda -type f (f = file):<\/p>\n<p style=\"color: #333333;\"><strong>sudo find \/ -type f -printf &#8216;%s %p\\n&#8217;| sort -nr | head -10<\/strong><\/p>\n<p style=\"color: #333333;\">Si desean especificar el tipo de archivo, o sea, solo tener en cuenta los .mp4 basta con agregar un -iname \u201c*.mp4\u2033 :<\/p>\n<p style=\"color: #333333;\"><strong>sudo find \/ -iname &#8220;*.mp4&#8221; -printf &#8216;%s %p\\n&#8217;| sort -nr | head -1<\/strong><\/p>","protected":false},"excerpt":{"rendered":"<p>Have you ever wanted to know what is the largest folder or file on your hard drive? The find command is great, it allows us to do many things (we have already talked about some here), here I bring you another utility of it. The following command will search the entire HDD and tell us which ones ...<\/p>","protected":false},"author":2,"featured_media":30186,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2026,2024,2014],"tags":[],"class_list":["post-30333","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-consola","category-linux","category-programacionweb"],"jetpack_featured_media_url":"https:\/\/webirix.com\/wp-content\/uploads\/2014\/04\/512px-Tux.svg_.png","_links":{"self":[{"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/posts\/30333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/comments?post=30333"}],"version-history":[{"count":4,"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/posts\/30333\/revisions"}],"predecessor-version":[{"id":30337,"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/posts\/30333\/revisions\/30337"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/media\/30186"}],"wp:attachment":[{"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/media?parent=30333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/categories?post=30333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/tags?post=30333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}