<?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 create a file in specified directory ? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-create-a-file-in-specified-directory/m-p/203874#M73814</link>
    <description>&lt;P&gt;Thanks &lt;A rel="user" href="https://community.cloudera.com/users/46293/sandeeprhct.html" nodeid="46293"&gt;@Sandeep Kumar&lt;/A&gt; for your prompt reply.&lt;BR /&gt;I have done the above step but file is not shown in that directory. Please see the below scree. is everything right : &lt;BR /&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/57422-directory.jpg"&gt;directory.jpg&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jan 2018 20:05:35 GMT</pubDate>
    <dc:creator>Learner_1122</dc:creator>
    <dc:date>2018-01-24T20:05:35Z</dc:date>
    <item>
      <title>How to create a file in specified directory ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-create-a-file-in-specified-directory/m-p/203872#M73812</link>
      <description>&lt;P&gt;Hi Guys,&lt;BR /&gt;I have user &lt;STRONG&gt;"Mark"&lt;/STRONG&gt; and it have directory &lt;STRONG&gt;"Cards"&lt;/STRONG&gt;. &lt;BR /&gt;Now i want to create a file in this directory &lt;STRONG&gt;"Cards" . &lt;BR /&gt;&lt;/STRONG&gt;I have tried below commands : &lt;BR /&gt;&lt;STRONG&gt;" mkdir cards" &lt;BR /&gt;" touch cards/largedeck.txt" &lt;BR /&gt;&lt;/STRONG&gt;but file was not created in that directory. &lt;BR /&gt;NOTE : i am using AWS machine. &lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 19:02:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-create-a-file-in-specified-directory/m-p/203872#M73812</guid>
      <dc:creator>Learner_1122</dc:creator>
      <dc:date>2022-09-19T19:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a file in specified directory ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-create-a-file-in-specified-directory/m-p/203873#M73813</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/44156/mudassarlhr.html" nodeid="44156"&gt;@Mudassar Hussain&lt;/A&gt;&lt;P&gt;If you are running a hadoop cluster in your AWS EC-2 instance and trying to create a file or folder then below are the command to achieve the same:&lt;/P&gt;&lt;PRE&gt;su - hdfs
hdfs dfs -mkdir /Mark
hdfs dfs -mkdir /Mark/Cards	
&lt;/PRE&gt;&lt;P&gt;Now to create a file in the specified folder you have to use touch command:&lt;/P&gt;&lt;PRE&gt;hdfs dfs -touchz /Mark/Cards/largedeck.txt&lt;/PRE&gt;&lt;P&gt;Here are some links which will help you to understand the same:&lt;/P&gt;&lt;P&gt;&lt;A href="https://hadoop.apache.org/docs/r2.4.1/hadoop-project-dist/hadoop-common/FileSystemShell.html#touchz"&gt;Apache Link for shell commands&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/88744/how-to-create-file-view-in-ambari.html"&gt;HCC - Link&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.hortonworks.com/HDPDocuments/Ambari-2.2.2.0/bk_ambari_views_guide/content/ch_using_files_view.html"&gt;HDP-DocsLink&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 18:43:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-create-a-file-in-specified-directory/m-p/203873#M73813</guid>
      <dc:creator>sandeepksaini</dc:creator>
      <dc:date>2018-01-24T18:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a file in specified directory ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-create-a-file-in-specified-directory/m-p/203874#M73814</link>
      <description>&lt;P&gt;Thanks &lt;A rel="user" href="https://community.cloudera.com/users/46293/sandeeprhct.html" nodeid="46293"&gt;@Sandeep Kumar&lt;/A&gt; for your prompt reply.&lt;BR /&gt;I have done the above step but file is not shown in that directory. Please see the below scree. is everything right : &lt;BR /&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/57422-directory.jpg"&gt;directory.jpg&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 20:05:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-create-a-file-in-specified-directory/m-p/203874#M73814</guid>
      <dc:creator>Learner_1122</dc:creator>
      <dc:date>2018-01-24T20:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a file in specified directory ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-create-a-file-in-specified-directory/m-p/203875#M73815</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/44156/mudassarlhr.html" nodeid="44156"&gt;@Mudassar Hussain&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The following two paths are completely different:&lt;/P&gt;&lt;P&gt;1. /user/Mark/cards&lt;/P&gt;&lt;P&gt;AND&lt;/P&gt;&lt;P&gt;2. /Mark/cards&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;You created the directory "/Mark/cards" in the "mkdir" commands&lt;/P&gt;&lt;P&gt;But you are trying to list the data of "/user/Mark/cards"&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Please check the output of following command to find your file "largedeck.txt"&lt;/P&gt;&lt;PRE&gt;# hadoop fs -ls /Mark/cards&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;So to avoid confusion .. please make sure that when you are creating a directory on HDFS  please define the full path.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 21:08:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-create-a-file-in-specified-directory/m-p/203875#M73815</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2018-01-24T21:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a file in specified directory ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-create-a-file-in-specified-directory/m-p/203876#M73816</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/3418/jsensharma.html" nodeid="3418" target="_blank"&gt;@Jay Kumar SenSharma&lt;/A&gt;Thanks a lot! &lt;BR /&gt;I got the desired output. but why it is showing &lt;STRONG&gt;"hdfs"&lt;/STRONG&gt; the owner instead of &lt;STRONG&gt;"Mark"&lt;/STRONG&gt; .although i change the ownership.&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="56455-hdfsowner.jpg" style="width: 812px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17246i50D1BB45CB4CA491/image-size/medium?v=v2&amp;amp;px=400" role="button" title="56455-hdfsowner.jpg" alt="56455-hdfsowner.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Correct me where i was wrong : &lt;BR /&gt;First of all i created user&lt;STRONG&gt; "Mark"&lt;/STRONG&gt; &lt;BR /&gt;&lt;STRONG&gt;[root@namenode] adduser Mark&lt;/STRONG&gt;
&lt;BR /&gt;then check the space for user : &lt;BR /&gt;&lt;STRONG&gt;
[root@namenode] hadoop fs -ls /user
&lt;/STRONG&gt;&lt;BR /&gt;My user not shown in the list so i create a space for my user &lt;BR /&gt;&lt;STRONG&gt;[root@namenode]  sudo -u hdfs hadoop fs - mkdir /user/Mark
&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[root@namenode] hadoop fs -ls /user  &lt;/STRONG&gt;(now user show in the list)&lt;BR /&gt;Change the ownership
&lt;BR /&gt;&lt;STRONG&gt;[root@namenode] sudo -u hdfs hadoop fs -chown Mark:hdfs /user/Mark
&lt;/STRONG&gt;&lt;BR /&gt;Now i login to user hdfs &lt;BR /&gt;&lt;STRONG&gt;
[hdfs@namenode] hdfs dfs -mkdir /user/Mark/cards&lt;/STRONG&gt;
&lt;BR /&gt;&lt;STRONG&gt; [hdfs@namenode] hdfs dfs -touchz /user/Mark/cards/largedeck.txt &lt;/STRONG&gt;&lt;BR /&gt; now login with &lt;STRONG&gt;"Mark"&lt;/STRONG&gt; user and then type&lt;BR /&gt;
[Mark@namenode] &lt;STRONG&gt;hadoop fs -ls /user/Mark/cards &lt;/STRONG&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 05:08:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-create-a-file-in-specified-directory/m-p/203876#M73816</guid>
      <dc:creator>Learner_1122</dc:creator>
      <dc:date>2019-08-18T05:08:09Z</dc:date>
    </item>
  </channel>
</rss>

