Home Forums Hortonworks Sandbox How to get started with Command line

This topic contains 1 reply, has 2 voices, and was last updated by  Michael Peterson 1 year, 1 month ago.

  • Creator
    Topic
  • #34190

    Roshan Amasa
    Member

    Hello all,

    I just started with Sandbox and I had couple of queries . I don’t know this is the right place to ask.
    But the questions seems to be simple , can i run Mapreduce jobs via command line .

    When I go through some of the blogs by entering as User – root and Pwd – hadoop I am successfully logging in . but from then when I use list command ls , it says I have only ambari file which is strange.

    can you help me how to go to Home folder from shell and other folders. I did try cd command , but no luck

    Regards

    Roshan A

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.

  • Author
    Replies
  • #34247

    I’m not familiar enough with Mapreduce to tell you exactly how to run the job via command line. The short answer though is yes, you should be able to do everything via the command line, including Mapreduce. There’s an MR tutorial here (https://hadoop.apache.org/docs/stable/mapred_tutorial.html) and the Hadoop commands here (https://hadoop.apache.org/docs/stable/commands_manual.html) that should help you get started. If anyone tells you different, they probably know more than me, listen to them :P

    As for the other questions, most of them seem to be generic *nix command systems. Remember, the Sandbox is just a VM image with everything preinstalled on a CentOS client. Any command that works on CentOS (or Red Hat/RHEL, or Fedora) should work on the sandbox. Generally goggling something like “how to change directories in Red Hat” will bring up a page.

    For your specific questions, commands are (everything inside the ‘ ‘, but not including ‘)
    ‘cd ~’ will bring you back to your home folder, which should be /root
    / is the very bottom directory in the unix file system, kinda like C:/ in windows, so /root would be the equivalent of C:/users/root
    When you use ‘ls’ it only tells you the contents of the directory you are in, since you’re in your user folder, you only see the ambari file. You can also use a command like ‘ls /var’ to see all files and folders in the /var directory. ‘ls -al’ gives you more details if you ever need it. Or you can just change to a different directory and run ‘ls’ there

    So if you want to navigate to another folder (change directory), use something like ‘cd /etc/flume/conf’ and you’ll go to the flume config directory.

    Also, most commands have help options. Sometimes this varies? in my experience anyway. Generally though something like ‘yum help’ will bring up the help text for yum. ‘man yum’ also brings up the manual page for yum. If you get it wrong, like ‘yum -?’ it’ll generally tell you there’s no such option as -? and give you a list of possible commands.

    Collapse
Viewing 1 replies (of 1 total)