<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: how to exclude .* files while executing &amp;quot;hdfs dfs -mv&amp;quot; command ? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/how-to-exclude-files-while-executing-quot-hdfs-dfs-mv-quot/m-p/225222#M187083</link>
    <description>&lt;P&gt;Except "." character and timestamp, all the files have the same name. So It's impossible to use pattern.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Oct 2017 13:40:56 GMT</pubDate>
    <dc:creator>thierry_vernhet</dc:creator>
    <dc:date>2017-10-23T13:40:56Z</dc:date>
    <item>
      <title>how to exclude .* files while executing "hdfs dfs -mv" command ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-exclude-files-while-executing-quot-hdfs-dfs-mv-quot/m-p/225220#M187081</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I would like to move lot of files of a hdfs directory but not the files with size at 0 and name like ".*"&lt;/P&gt;&lt;P&gt;For example, move only files "file3" "file4" file5" but not the files "file1" and "file2". These ones have'ont been not entirely written in hdfs directory when I execute the "hdfs dfs -mv" command.&lt;/P&gt;&lt;P&gt;hdfs@host:~&amp;gt;
hadoop dfs -ls /mydirectory&lt;/P&gt;&lt;P&gt;Found 1942
items&lt;/P&gt;&lt;P&gt;-rw-r-----  3 xagcla02 hdfs   0 2017-10-19 18:07 /mydirectory/&lt;STRONG&gt;.file1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;-rw-r-----  3 xagcla02 hdfs   0 2017-10-19 18:07 /mydirectory/&lt;STRONG&gt;.file2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;-rw-r-----  3 xagcla02 hdfs  2540 2017-10-19 18:07 /mydirectory/file3&lt;/P&gt;&lt;P&gt;-rw-r-----  3 xagcla02 hdfs  2540 2017-10-19 18:07 /mydirectory/file4&lt;/P&gt;&lt;P&gt;-rw-r-----  3 xagcla02 hdfs  5252 2017-10-19 18:07 /mydirectory/file5&lt;/P&gt;&lt;P&gt;…&lt;/P&gt;&lt;P&gt;Thanks for your feedbacks&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 23:14:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-exclude-files-while-executing-quot-hdfs-dfs-mv-quot/m-p/225220#M187081</guid>
      <dc:creator>thierry_vernhet</dc:creator>
      <dc:date>2017-10-19T23:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to exclude .* files while executing "hdfs dfs -mv" command ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-exclude-files-while-executing-quot-hdfs-dfs-mv-quot/m-p/225221#M187082</link>
      <description>&lt;P&gt;There isn't an exclusion filter per se (there isn't one for the native UNIX mv command either) but if the files you want to move are named with a pattern you could use that pattern to select only those files to move. The wildcard operator (*) will come in handy in this situation as well.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Oct 2017 04:09:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-exclude-files-while-executing-quot-hdfs-dfs-mv-quot/m-p/225221#M187082</guid>
      <dc:creator>anarasimham</dc:creator>
      <dc:date>2017-10-21T04:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to exclude .* files while executing "hdfs dfs -mv" command ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-exclude-files-while-executing-quot-hdfs-dfs-mv-quot/m-p/225222#M187083</link>
      <description>&lt;P&gt;Except "." character and timestamp, all the files have the same name. So It's impossible to use pattern.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 13:40:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-exclude-files-while-executing-quot-hdfs-dfs-mv-quot/m-p/225222#M187083</guid>
      <dc:creator>thierry_vernhet</dc:creator>
      <dc:date>2017-10-23T13:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to exclude .* files while executing "hdfs dfs -mv" command ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-exclude-files-while-executing-quot-hdfs-dfs-mv-quot/m-p/225223#M187084</link>
      <description>&lt;P&gt;you can try below script:&lt;/P&gt;&lt;PRE&gt;for f in $(hdfs dfs -ls /tmp/files | awk '$1 !~ /^d/ &amp;amp;&amp;amp; $5 == "0" { print $8 }'); do hdfs dfs -mv "$f" /tmp/files/exclude-files; done&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Oct 2017 17:56:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-exclude-files-while-executing-quot-hdfs-dfs-mv-quot/m-p/225223#M187084</guid>
      <dc:creator>mcapavan</dc:creator>
      <dc:date>2017-10-23T17:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to exclude .* files while executing "hdfs dfs -mv" command ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-exclude-files-while-executing-quot-hdfs-dfs-mv-quot/m-p/225224#M187085</link>
      <description>&lt;P&gt;Thanks a lot Pavan., I've just modified   ...     $5 == "0"  ...    by    ...    $5 != "0"  ...   because I don't want to move files with "0"size.&lt;/P&gt;&lt;OL&gt;
&lt;/OL&gt;&lt;P&gt;for f in $(hdfs dfs -ls /tmp/files | awk '$1 !~ /^d/ &amp;amp;&amp;amp; $5 != "0" { print $8 }');do hdfs dfs -mv "$f"/tmp/files/exclude-files;done&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 18:35:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-exclude-files-while-executing-quot-hdfs-dfs-mv-quot/m-p/225224#M187085</guid>
      <dc:creator>thierry_vernhet</dc:creator>
      <dc:date>2017-10-23T18:35:49Z</dc:date>
    </item>
  </channel>
</rss>

