{"id":829,"date":"2005-08-13T17:00:00","date_gmt":"2005-08-14T00:00:00","guid":{"rendered":"http:\/\/kodegeek.com\/blog\/?p=829"},"modified":"2005-08-13T17:00:00","modified_gmt":"2005-08-14T00:00:00","slug":"trucos-unix-%c2%bfcomo-ver-la-lista-de-directorios-rapidamente","status":"publish","type":"post","link":"http:\/\/kodegeek.com\/blog\/2005\/08\/13\/trucos-unix-%c2%bfcomo-ver-la-lista-de-directorios-rapidamente\/","title":{"rendered":"Trucos UNIX: \u00bfComo ver la lista de directorios r\u00e1pidamente?"},"content":{"rendered":"<p><img decoding=\"async\" src=\"http:\/\/photos22.flickr.com\/34053237_75070239f6_o.jpg\" border=\"0\" \/><\/p>\n<p>Este es el tipo de cosas que uno necesita hacer r\u00e1pido, as\u00ed que \u00bfpor donde empezar?. Supongamos que s\u00f3lo quiero ver los directorios y nada m\u00e1s.<\/p>\n<p>Bueno, el cl\u00e1sico: Usando ls y grep:<\/p>\n<pre><br \/>[josevnz@localhost ~]$ l<span style=\"color: rgb(255, 0, 0);\">s -l \/|egrep \"^drwx\"<\/span><br \/>drwxr-xr-x    2 root root  4096 Jun 29 20:45 bin<br \/>drwxr-xr-x    4 root root  1024 Jun 19 22:09 boot<br \/>drwxr-xr-x   11 root root  5040 Aug 13 07:52 dev<br \/>drwxr-xr-x   82 root root 12288 Aug 13 07:51 etc<br \/>drwxr-xr-x    3 root root  4096 Jun 19 22:39 home<br \/>drwxr-xr-x   11 root root  4096 Jun 29 20:41 lib<br \/>drwx------    2 root root 16384 Jun 19 18:04 lost+found<br \/>drwxr-xr-x    4 root root  4096 Aug 13 07:51 media<br \/>drwxr-xr-x    2 root root     0 Aug 13 07:51 misc<br \/>drwxr-xr-x    4 root root  4096 Jul 17 23:43 mnt<br \/>drwxr-xr-x    2 root root     0 Aug 13 07:51 net<br \/>drwxr-xr-x    2 root root  4096 May 23 00:28 opt<br \/>drwxr-x---   17 root root  4096 Aug 10 06:36 root<br \/>drwxr-xr-x    2 root root 12288 Jun 29 20:45 sbin<br \/>drwxr-xr-x    1 root root     0 Aug 13 03:50 selinux<br \/>drwxr-xr-x    2 root root  4096 May 23 00:28 srv<br \/>drwxr-xr-x   10 root root     0 Aug 13 03:50 sys<br \/>drwxrwxrwt   13 root root  4096 Aug 13 15:08 tmp<br \/>drwxr-xr-x   15 root root  4096 Jun 22 21:46 usr<br \/>drwxr-xr-x   22 root root  4096 Jun 19 22:26 var<br \/><\/pre>\n<p>Me da mucha informaci\u00f3n y s\u00f3lo los directorios.<br \/>Otra forma, usando &#8216;find&#8217;:<\/p>\n<pre>[josevnz@localhost ~]$ <span style=\"color: rgb(255, 0, 0);\">find \/ -maxdepth 1 -type d<\/span><br \/>\/<br \/>\/boot<br \/>\/usr<br \/>\/lib<br \/>\/opt<br \/>\/selinux<br \/>\/dev<br \/>\/var<br \/>\/root<br \/>\/sbin<br \/>\/srv<br \/>\/tmp<br \/>\/misc<br \/>\/media<br \/>\/etc<br \/>\/bin<br \/>\/mnt<br \/>\/lost+found<br \/>\/proc<br \/>\/home<br \/>\/net<br \/>\/sys<br \/><\/pre>\n<p>As\u00ed s\u00f3lo veo los directorios. \u00bfQue pasa si le agrega la opci\u00f3n &#8216;-ls&#8217;?<\/p>\n<p>Quizas pudiera usar el programa &#8216;tree&#8217; pero no viene instalado por omisi\u00f3n (y usted lo que queria era resolver el problema r\u00e1pido, \u00bfno es as\u00ed?)<\/p>\n<p>\u00bfComo lo har\u00eda usted, pero r\u00e1pido?<\/p>\n<p>Buscar en Technorati: <a href=\"http:\/\/technorati.com\/tag\/unix\" rel=\"tag\">unix<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Este es el tipo de cosas que uno necesita hacer r\u00e1pido, as\u00ed que \u00bfpor donde empezar?. Supongamos que s\u00f3lo quiero ver los directorios y nada m\u00e1s. Bueno, el cl\u00e1sico: Usando ls y grep: [josevnz@localhost ~]$ ls -l \/|egrep &#8220;^drwx&#8221;drwxr-xr-x 2 root root 4096 Jun 29 20:45 bindrwxr-xr-x 4 root root 1024 Jun 19 22:09 bootdrwxr-xr-x <a class=\"read-more\" href=\"http:\/\/kodegeek.com\/blog\/2005\/08\/13\/trucos-unix-%c2%bfcomo-ver-la-lista-de-directorios-rapidamente\/\">[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/kodegeek.com\/blog\/wp-json\/wp\/v2\/posts\/829"}],"collection":[{"href":"http:\/\/kodegeek.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/kodegeek.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/kodegeek.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/kodegeek.com\/blog\/wp-json\/wp\/v2\/comments?post=829"}],"version-history":[{"count":0,"href":"http:\/\/kodegeek.com\/blog\/wp-json\/wp\/v2\/posts\/829\/revisions"}],"wp:attachment":[{"href":"http:\/\/kodegeek.com\/blog\/wp-json\/wp\/v2\/media?parent=829"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/kodegeek.com\/blog\/wp-json\/wp\/v2\/categories?post=829"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/kodegeek.com\/blog\/wp-json\/wp\/v2\/tags?post=829"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}