When you open a command terminal, you start in some default directory. The starting directory can be set, but you'll have to figure out how to do that on some Ubuntu/Unix forum (or search google). You might have to create a file(if it doesn't already exist) with a specific name like .profile, add some lines to it, and put it in a specific directory. It also depends on what "shell" you are using. For all intents and purposes, you can equate "the shell" with the command window. The ls -al command will reveal all the files in a directory--including hidden files that start with a dot.

The following:

$ mkdir begperl $ cd begperl
commands your operating system to mkdir(make a directory) called begperl inside the current directory. So if your default directory (the one the command window opens in) is:

/users/mike/my_programs

the mkdir command would have created the directory /users/mike/my_programs/begperl.

Then the cd (change directory) command says to search the current directory for the directory called begperl and switch to that directory if found. You can always use an absolute path to switch to any directory without knowing what the current directory is:

$cd /users/mike/my_programs/begperl

I suggest you set your prompt($) to indicate what directory you are in. You will have to figure out how to do that on an Ubuntu/Unix forum as well. After you set the prompt to display the directory, the prompt will look like this:

/users/mike/my_programs$ cd begperl /users/mike/my_programs/begperl$

Finally, when you write:

$perl helloworld.pl

that commands your operating system to look for a program called 'perl' and have perl excute a file in the current directory called helloworld.pl.


In reply to Re: I come in peace for I seek your wisdom dear monks :) by 7stud
in thread I come in peace for I seek your wisdom dear monks :) by Samurai Monkey

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.