{"id":16,"date":"2013-08-07T22:59:00","date_gmt":"2013-08-07T22:59:00","guid":{"rendered":"http:\/\/ibcloud.com.br\/blog\/listar-somente-nome-de-arquivos-no-linux\/"},"modified":"2014-05-13T02:54:31","modified_gmt":"2014-05-13T02:54:31","slug":"listar-somente-nome-de-arquivos-no-linux","status":"publish","type":"post","link":"https:\/\/humanizati.com.br\/blog\/2013\/08\/07\/listar-somente-nome-de-arquivos-no-linux\/","title":{"rendered":"Listar somente nome de arquivos no Linux"},"content":{"rendered":"<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">H\u00e1 duas maneiras pr\u00e1ticas e simples de fazer esta opera\u00e7\u00e3o.&nbsp;<\/span><br \/><span style=\"font-family: Arial, Helvetica, sans-serif;\"><br \/><\/span><span style=\"font-family: Arial, Helvetica, sans-serif;\">S\u00e3o elas:<\/span><br \/><span style=\"font-family: Arial, Helvetica, sans-serif;\"><br \/><\/span><span style=\"font-family: Arial, Helvetica, sans-serif;\">1 &#8211; entrar no diret\u00f3rio e dar um<\/span><br \/><span style=\"font-family: Arial, Helvetica, sans-serif;\">&nbsp; &nbsp; &nbsp;<\/span><br \/><span style=\"font-family: Arial, Helvetica, sans-serif;\">&nbsp; &nbsp; &nbsp;# ls -m1<\/span><br \/><span style=\"font-family: Arial, Helvetica, sans-serif;\"><br \/><\/span><span style=\"font-family: Arial, Helvetica, sans-serif;\">2 &#8211; executar um find em conjunto com xargs em busca do arquivo<\/span><br \/><span style=\"font-family: Arial, Helvetica, sans-serif;\"><br \/><\/span><span style=\"font-family: Arial, Helvetica, sans-serif;\">&nbsp; &nbsp; &nbsp;# find \/diretorio -name &#8216;*nomedoarquivo*&#8217; | xargs -n1 basename<\/span><br \/><span style=\"font-family: Arial, Helvetica, sans-serif;\"><br \/><\/span><span style=\"font-family: Arial, Helvetica, sans-serif;\">Estas s\u00e3o duas maneiras r\u00e1pidas e praticas, existem outras maneiras e deriva\u00e7\u00f5es por exemplo atrav\u00e9s do uso do xargs, sed e awk em conjunto com &nbsp;find, ls e outros.<\/span><br \/><span style=\"font-family: Arial, Helvetica, sans-serif;\"><br \/><\/span><span style=\"font-family: Arial, Helvetica, sans-serif;\">Fica o registro! Coisa bem r\u00e1pida!<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>H\u00e1 duas maneiras pr\u00e1ticas e simples de fazer esta opera\u00e7\u00e3o.&nbsp;S\u00e3o elas:1 &#8211; entrar no diret\u00f3rio e dar um&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;# ls -m12 &#8211;&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[25,24],"class_list":["post-16","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-listar-so-nome-do-arquivo","tag-ls-lista-so-arquivo"],"_links":{"self":[{"href":"https:\/\/humanizati.com.br\/blog\/wp-json\/wp\/v2\/posts\/16","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/humanizati.com.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/humanizati.com.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/humanizati.com.br\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/humanizati.com.br\/blog\/wp-json\/wp\/v2\/comments?post=16"}],"version-history":[{"count":1,"href":"https:\/\/humanizati.com.br\/blog\/wp-json\/wp\/v2\/posts\/16\/revisions"}],"predecessor-version":[{"id":76,"href":"https:\/\/humanizati.com.br\/blog\/wp-json\/wp\/v2\/posts\/16\/revisions\/76"}],"wp:attachment":[{"href":"https:\/\/humanizati.com.br\/blog\/wp-json\/wp\/v2\/media?parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/humanizati.com.br\/blog\/wp-json\/wp\/v2\/categories?post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/humanizati.com.br\/blog\/wp-json\/wp\/v2\/tags?post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}