1,234
edits
Changes
no edit summary
{{Admon/caution|DO NOT USE THIS VERSION OF THE LAB. This page will no longer be updated.|'''New version here:''' https://seneca-ictoer.github.io/ULI101/A-Tutorials/tutorial1<br />'''Andrew's students please go here:''' http://wiki.littlesvr.ca/wiki/OPS145_Lab_1}}
=USING YOUR MATRIX SERVER ACCOUNT=
===Tutorial Reference Material===
|- valign="top" style="padding-left:15px;"
|colspan="2" |'''Slides:'''<ul><li>Week 1 Lecture 1 Notes:<br> [[Mediahttps://wiki.cdot.senecacollege.ca/uli101/slides/ULI101-Week11.1.pdf | PDF]] | [https://matrixwiki.cdot.senecacollege.ca/~chris.johnsonuli101/ULI101slides/ULI101-Week11.1.pptx PPTX]</li><li>Week 1 Lecture 2 Notes:<br> [[Mediahttps://wiki.cdot.senecacollege.ca/uli101/slides/ULI101-Week11.2.pdf | PDF]] | [https://matrixwiki.cdot.senecacollege.ca/~jason.carmanuli101/slides/ULI101-Week11.2.pptx PPTX] <br></li></ul>'''Tutorials:'''<ul><li>[https://wiki.cdot.senecacollege.ca/wiki/Tutorial_1:_Using_Your_Matrix_Server_Account#INVESTIGATION_1:_ACCESSING_YOUR_MATRIX_LINUX_ACCOUNT HOWTO: Access Your Matrix Account]</li><li>[http://czegel.com/seneca/uli101/lectures/Lecture1.html Les Czegel's Week 1 Notes (HTML)]</li></ul>'''Windows SSH client Software:'''<ul><li>[http://www.sfsu.edu/ftp/win/ssh/SSHSecureShellClient-3.2.9.exe SSH/SFTP]</li><li>[https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html Putty]</li><li>[https://www.bitvise.com/ssh-client-download Bitvise SSH Client]</li><li>[https://mobaxterm.mobatek.net/download-home-edition.html MovaXterm]</li></ul>
| style="padding-left:15px;" |'''Matrix Account Access:'''
= KEY CONCEPTS=
===Purpose of Having a Your Student Account on Matrix Linux Server Account===
While attending Seneca College, you will be using many different computer systems.
|-
| style="padding-left:0px;width:10%" |'''mylearn.senecacollege.ca'''
| style="padding-left:15px;width:65%" |Learning Content Management System (''Link to Resources'' / ''Student Grades'' / ''Online Quizzes'')
|-
| style="padding-left:0px;width:10%" |'''wiki.cdot.senecacollege.ca'''
| style="padding-left:15px;width:65%" |''Student Lecture Notes'' / ''Tutorials'' (weekly, review) / ''Practice Questions'' / ''Additional Learning Resources''
|-
| style="padding-left:0px;width:10%" |'''<span style="color:blue;">matrix.senecacollege.ca</span>'''
| style="padding-left:15px;width:65%" |Matrix is our Linux Account server environment used for "''hands-on Practicepractice''". Each ULI101 student has an account on this server.
|}
[[Image:cli-prompt.png|thumb|right|120px|A '''shell''' is an interface / interpreter to allow a user to communicate with the Linux computer system. ]]
Although you need to study concepts throughout this course (slides, etc.), you will also need to get '''hands-on practice running Linux commands as well as performing and submitting online tutorials'''.
In Unix/Linux, a '''shell''' is simply an '''interface''' to allow a user to communicate with the Linux computer system (server). Linux shells have evolved (improved) over a period of time. You will be using the '''Bash Shell''' which is considered to be ''user-friendly''. By understanding how to issue Linux commands, you can create a file that contains Linux commands (called a '''shell script''') later in this course to automate tasks to make you a more '''productive''' Linux user and system administrator.
:* Issuing '''Linux commands'''
:* Becoming productive using the Linux '''command prompt''' ('''shell''')
:* Performing '''Linux Tutorials''' ('''11Weekly Tutorials x 2% = 22% of your final grade''')
:* Performing '''Linux Practice Questions'''
:* Performing '''Review Tutorial Questions''' ('''28 Sections x 1% = 8% of your final grade''')
===Connecting to the Seneca Student VPN===
[[Image:gp1.png|thumb|right|130px|'''Seneca Student VPN''' ]]
In the next investigation, you will learn how to '''connect''' to and '''login''' to your Matrix server account from a remote computer<br>such as your '''home desktop computer''', '''laptop''' or '''tablet''' computer.<br><br>
===Connecting to Your Matrix Account===
[[Image:cls-shell.png|thumb|right|100px|Connect to Matrix via'''ssh''' command]]There are two basic methods to connecting to your Matrix account. '''Method 1: Run ssh Command from command prompt:'''
[[Image:ssh-main-window.png|thumb|right|100px|Connect to Matrix via '''graphical''' SSH Program ]]
'''NOTE:''' You instructor may show you how to run a graphic Linux VM in order to connect to your Matrix account (if interested, refer to the optional tutorial at the end of this semester).
=INVESTIGATION 1: ACCESSING YOUR MATRIX LINUX ACCOUNT=
In this section, you will learn how to access your Matrix Linux account by two different methods:
:* From your '''home computer''' <br>
:* From a '''workstation in a Seneca College''' lab via '''MyApps'''
===METHOD 1: CONNECTING TO YOUR MATRIX ACCOUNT FROM YOUR HOME COMPUTER===
<table style="margin-left:50px;">
<tr valign="top" style="text-align:center;">
<th>'''Newer Version of Windows 10(or above):'''</th> <th>'''MacOSXmacOS:''' </th>
<th>'''Linux:''' </th>
</tr>
# Start your workstation in your lab and login to your Seneca Windows account.<br><br>
# Make certain that the '''MyApps''' window is open. This window should have opened shortly after you logged into your Windows workstation. If the application windows is not open, click on the '''MyApps''' icon on the desktop to launch).<br><br>[[Image:ssh-main-window.png|thumb|right|150px|SSH Client Application Window ]]<span style="color:red;font-weight:bold;">NOTE: You may be required to validate in order to use MyApps correctly. If you see near the top of the screen "requires validation", then click on that area to connect to validate.</span><br><br>
# Click on the '''Search Apps''' area located in the top right corner of the MyApps window and type the word: <span style="color:blue;font-weight:bold">ssh</span><br><br>
# Several SSH applications will appear. <br><br>'''NOTE:''' All of these applications allow you to connect to your Matrix account.<br>We will use the application called '''SSH Secure Shell Client''' for this practice tutorial.<br><br>
# It is recommended to repeat these steps with connecting to your Matrix account from a Seneca lab workstation until you become comfortable with the process.<br><br>
In the next investigation, you will learn how to issue Linux commands from the command prompt (referred to as the "shell"), learn how to get help with Linux commands, use command-line editing short cut keys, and run a program to confirm that you connected to your Matrix account in order to get marks for this online tutorial.<br><br>
=INVESTIGATION 2: USING THE LINUX SHELL =
In this investigation, you will learn how to use the Linux Shell. Topics in the section include:
:* Learn how to get '''help''' for Linux commands via the '''online manual''' (i.e. '''man''' command).
:* Perform '''Basic Shell Editing'''
:* Issue a '''program''' to confirm that you connected to your Matrix account<br><br> ==Linux Command Structure== The Bash shell allows you to interact with Linux by typing commands. '''The basic Linux command structure is as follows:'''
Some Linux commands can be used as-is (e.g. '''pwd''', '''date''', 'The General ''ls''', '''cal'''), but many Linux Command Structure is as follows:commands can also be issued with arguments (e.g. '''cal 2002''', '''cd /bin''', '''<br><span style="fontls -family:courier;color:blue;fontl -weight:bold">command argument1 argument2 .a /bin''' ).. </span>
An argument is used to change the default behaviour of a command. Arguments come in three major forms: # A command '''argumentoption''' can respresent.#* Example:<code>-l</code>:* a # A '''file pathname'''.#* Example:* a command '''option'''<code>/etc</code>:* a # A series of characters (i.e. '''text''') that the command can use .#* Example: <code>"Hello, world."</code>
An '''argument''' is <u>must be separated</u> from a command (or and from other arguments) by whitespace (a '''SPACE''', '''MULTIPLE SPACES''' or a '''TAB''').<br><br>
'''Perform the Following Steps:'''
# Make certain Confirm that you are logged into your Matrix account.<br><br># Issue the following Linux command: <span style="font-family:courier;color:blue;font-weight:bold">pwd</span><br><br>#* '''Explanation:''' The output from this Linux command basically shows your '''current location''' in on the Matrix server(otherwise known as your '''p'''resent '''w'''orking '''d'''irectory).<br>This represents a '''directory pathname''' to your home directory. We will discuss ''pathnames'' later in this course.<br><br># Issue the following Linux command: <span style="font-family:courier;color:blue;font-weight:bold">ls</span><br><br>#* '''Question:''' What do you notice?<br><br>#* '''Answer:''' If there were are any files in your home directory, just only their file names would be are displayed.<br><br># Issue Change your directory location by issuing the following Linux command: <span style="font-family:courier;color:blue;font-weight:bold">cd /binetc</span><br><br># Issue the following Linux command to confirm your changed current location: <span style="font-family:courier;color:blue;font-weight:bold">pwd</span>#* '''Result:''' Your Linux session should display <brcode>/etc/<br/code>when running this command. If your output is different, retrace your steps to make sure you haven't skipped anything or had a typo in a command.# Issue the following Linux commandagain: <span style="font-family:courier;color:blue;font-weight:bold">ls</span><br><br>#* '''Question:''' What do you notice?<br><br>How is this different from the last time you ran it?# Issue Re-run the following Linux ls command using an '''option''': <span style="font-family:courier;color:blue;font-weight:bold">ls -l</span><br><br>#* '''Question:''' What do you notice?<br><br>#* '''Answer:''' The '''-l''' option combined with the '''ls''' command provides displays a '''detailed''' ("''long''") listing of the same files , providing you with more information on a separate line for about each file.<br><br>This is called metadata (data about data), and includes information such as last modified date, file size, ownership and permissions.# Issue the following Linux command to return Return to your home directory: <span style="font-family:courier;color:blue;font-weight:bold">cd</span><br><br># Issue the following Linux command Now confirm you've changed back to confirm your current locationhome directory: <span style="font-family:courier;color:blue;font-weight:bold">pwd</span>#* '''Result:''' The shell should display <brcode>/home/''yourusername''<br/code># Issue the following Linux command: <span style="font-family:courier;color:blue;font-weight:bold">ls /bin</span><br><br> # Issue the following Linux command to confirm your current location: <span style="font-family:courier;color:blue;font-weight:bold">pwd</span><br><br>#* '''Question:''' What do you notice?<br><br>#* '''Question:''' What makes this command with that argument useful if you are current currently located in your home directory?<br><br># Issue a Linux command that you have already learned to change to your '''home''' directory<br>and to '''confirm''' that you have returned to your home directory.<br><br># Issue the following Linux command: <span style="font-family:courier;color:blue;font-weight:bold">clear</span><br><br>#* '''Question:''' What do you notice? How would Why is this command be helpful?<br>#* '''FYITip:''' The short-cut shortcut keys to clear the screen for the Bash shell isare: <span style="font-family:courier;color:font-weight:bold">ctrl-l</span><br><br># Issue the following Linux command: <span style="font-family:courier;color:blue;font-weight:bold">who</span><br><br>#* '''Question:''' What information does this command show?<br><br>#* '''Answer:''' This command lists users that are logged into the same Matrix Linux server as yourself.<br>#* '''NOTE:''' Remember that the Matrix Linux cluster contains several servers, so it does not (or nodes). It won't display<br>all users that are logged onto those other machines within that into the cluster!<br><br>, only the ones on the same node as you. # Issue the following Linux command: <span style="color:blue;font-weight:bold">whoami</span><br><br>#* '''Question:''' What does this command display? #* '''Question:''' What do you think is the purpose of this command?<br><br># Issue the following Linux command: <span style="font-family:courier;color:blue;font-weight:bold">cal</span><br><br>#* '''Question:''' What is the purpose of does this commanddo?<br><br># Issue the following Linux command: <span style="font-family:courier;color:blue;font-weight:bold">cal 20212035</span><br><br>What #* '''Question:''' How and why is the purpose of this command using this argumentoutput different?<br><br># Issue the following Linux command: <span style="font-family:courier;color:blue;font-weight:bold">cal 2 20212035</span><br><br>What is the purpose of this command using those two #* '''numbersQuestion:''' as argumentsWhat do each of these numbers do?<br><br>#* '''Getting Help with Linux CommandsQuestion:'''What do you think would happen if you reversed the order of those arguments? (i.e. cal 2035 2)
With the Linux OS containing over '''Command Line Editing2500'''[[Image:commandcommands and utilities, it's important for Linux users and Linux system administrators (sysadmin) to learn how to use commands “on-linethe-editing.png|thumb|right|520px|Command Line Editing Shortcut Keysfly”. ]]
The '''man''' utility is an interactive collection of manual pages that provides information on how to use a given command (i.e. '''command usage''', '''acceptable command arguments''', '''command options''', '''examples''').
You will now learn how to perform '''command line editing''' to correct syntax errors while typing Linux commands PRIOR to pressing the ENTER key.
==Command Line Editing==
[[Image:command-line-editing.png|thumb|right|520px|Command Line Editing Shortcut Keys. ]]
Learning '''shortcut keys''' in any OS terminal will allow you to be more productive as a ''Linux user'' or ''Linux System Administrator'' (commonly referred to as: '''Linux sysadmin''').
Let's learn a few common Bash Shell keyboard shortcut keys and find out where you can access online help for additional shortcuts (if required).
'''Perform the Following Steps:'''
# Press the <span style="font-family:courier;color:blue;font-weight:bold">up arrow</span> key combination, and see what happens when you press <span style="font-family:courier;color:blue;font-weight:bold">BACKSPACE</span> , <span style="font-family:courier;color:blue;font-weight:bold"><ctrl><BACKSPACE></span> and <span style="font-family:courier;color:blue;font-weight:bold"><ctrl><h></span>.<br>Why is it important to know those series of key combinations?<br><br>
# Press the <span style="font-family:courier;color:blue;font-weight:bold">ctrl-u</span> key combination to clear the line.<br><br>
# Press the <span style="font-family:courier;color:blue;font-weight:bold">ctrl-l</span> key combination. What happens? What is the advantage of using '''ctrl-u''' as opposed to '''ctrl-l'''?<br><br>The Bash shortcut keys that you just learned are sufficient to perform Bash Shell editing.<br>Although you are NOT required to learn other short-cut keys, here is a link to a listing in case you are interested:<br>[https:// ostechnix.com/list-useful-bash-keyboard-shortcuts/ Useful Bash Shell Keyboard Shortcuts]<br><br>'''Running a Shell Script to Check Student Online Tutorial Participation'''
These programs (known as Shell Scripts) will check your work and offer feedback if you made mistakes, so you can make corrections. Making corrections (i.e. troubleshooting) and re-running these checking programs until you are successful will help students gain "hands-on" experience as well as "trouble-shooting experience.
If you have correctly completed the required tasks, the user can proceed. If the checking shell script detects an '''error''', then it will provide feedback to allow the student to fix that problem so they can re-run the checking shell scripts until they have successfully completed a task.
'''Perform the Following Steps:'''
# Make certain that your current directory is '''your home directory'''<br>By by entering the following Linux command:<br>#* <span style="color:blue;font-weight:bold;font-family:courier;">cd</span><br><br>#Issue the following command to run a checking script :<br>#* <span style="font-family:courier;color:blue;font-weight:bold">~uli101/week1-check</span><br><br>#* '''Note:''' The beginning character "'''~'''" is called '''tilde'''. You get this character by pressing '''SHIFT''' + '''`'''<br>(which is the key to the left of the number 1 on your keyboard). <br><br># Your screen should clear and indicate that you have proved that you have successfully logged in.<br><br># An email will be sent to your Seneca email as '''confirmation''' in case your ULI101 professor is assigning marks to these tutorials.<br><br>#* Keep those confirmation email messages for the duration of this semester as proof that you have completed those checking scripts in case there is a discrepancy in tutorial grades.<br><br>
<!--
The purpose of this section is to obtain '''extra practice''' to help with '''quizzes''', your '''midterm''', and your '''final exam'''.
Here is a link to the MS a Word Document document of ALL of the questions displayed below but with extra room to answer on the document tosimulate a quiz:
: https://ictwiki.cdot.senecacollege.ca/~murray.saululi101/uli101files/uli101_week1_practice.docx
Your instructor may take-up these questions during class. It is up to the student to attend classes in order to obtain the answers to the following questions. Your instructor will NOT provide these answers in any other form (eg. e-mail, etc).
'''Review Questions:'''
# What character(s) are used to '''separate''' commands and arguments?
# Create a '''table''' listing each Linux command, useful options that were mentioned in this tutorial for the following Linux commands:<br>'''pwd''' , '''cd''' , '''ls''' , '''cal''' , '''date''' , '''who''' , '''w''' , '''whoami''' , '''who am I''' , '''clear'''
_________________________________________________________________________________
Author: Murray Saul
License: LGPL version 3
Link: https://www.gnu.org/licenses/lgpl.html
_________________________________________________________________________________
[[Category:ULI101]]