Open main menu

CDOT Wiki β

Changes

Tutorial 1: Using Your Matrix Server Account

52 bytes added, 16:32, 13 May 2023
Getting Help with Linux Commands
==Getting Help with Linux Commands==
With the Linux OS containing over '''2500''' commands and utilities, it is good 's important for a Linux user or <br>users and Linux system administrator administrators (sysadmin) to learn about how to use commands “on-the-fly”.<br><br> The '''man''' command can provide utility is an interactive collection of manual pages that provides information on how to use a given command<br>(i.e. '''command usage''', '''acceptable command arguments''', '''command options''', '''examples''').<br><br> # Issue For an example, issue the following commandfor the manual page about the manual utility: <span style="font-family:courier;color:blue;font-weight:bold">man man</span><br><br>#* You may notice that the online manual categories commands into sections or '''numbered volumes'''.<br><br># Type Press the '''SPACE''' key to move to the next screen.<br><br>#* '''Question:''' How many '''volume numbers''' are contained in the man pages (like '''executable commands''',<br>'''games''', or '''system administrator commands''')?<br><br>'''TIP:''' # You can use the following '''short-cut shortcut keys''' within the man command to <br>help navigate throughout this utility to get help with the ls command (refer to table below):<br><br>#::<table cellpadding="3"><tr><th style="border-bottom: 1px solid black;">Keyboard Shortcut</th><th style="border-bottom: 1px solid black;">Purpose</th></tr><tr><td>'''ENTER'''</td><td>Move down one line</td></tr><tr><td>'''SPACEBAR'''</td><td>Move one screen down</td></tr><tr><td>'''&lt;ctrl&gt;&lt;b&gt;'''</td><td>Move one screen up</td></tr><tr><td>'''/pattern/'''</td><td>Search for Pattern</td></tr><tr><td>'''q'''</td><td>quit man utility</td></tr></table><br># If you are connected to Matrix through a terminal application, you can also use your mouse's scroll wheel.# Press the letter <span style="font-family:courier;color:blue;font-weight:bold">q</span> key to exit the man command.<br><br># Issue Use the following Linux command ''man'' utility to get help with the ''ls '' command: <span style="font-family:courier;color:blue;font-weight:bold">man ls</span><br><br># Navigate through the man utility for the '''ls''' Linux command manual page and note write down the '''option letters''' that correspond to the following descriptions:<br><ul><li>#*"'''use a long listing format'''"</li><li>#*"'''do not ignore entries starting with .'''" (i.e. hidden files)</li><li>#*"'''sort by file size'''"</li><li>#*"'''append indicator (one of */=>&|) to entries'''" (i.e. type of file)</li></ul><br># Exit the man utility for the ''ls'' command.<br><br># Issue the '''ls''' command for using <u>each</u> of those option letters you noted in '''step 5''' to see how this the command differs for 's output changes with each option.<br><br>#* '''NOTE:''' The '''man''' utility can be used with the '''-k''' option to help list Linux commands that match a text pattern<br>that is contained within the help screen for a Linux command.<br><br># '''Pipeline commands''' can be used to filter-out unnecessary output. In the next command that you will be issuing,<br>the output from the '''man -k''' command, is sent into the '''grep''' command to ''filter'' (i.e. ''trap'') only output that matches the pattern "8"<br>(The number "8" refers to the category of type of command - in this case, administration commands).<br><br>We will learn more about pipeline commands later in this course.<br><br># Issue the following Linux pipeline command: <span style="font-family:courier;color:blue;font-weight:bold">man -k user | grep 8</span><br><br>#* '''Question:''' How does this ''pipeline command'' make it easier to obtain information regarding man command?<br><br># If you wish to change your passwordon typical Linux systems, you can change it by issuing the command: <span style="font-family:courier;color:blue;font-weight:bold">passwd</span><br>What option for the passwd command can be used to change user info (such as name)?<br>#* '''HintWARNING:''' use the Do '''NOT'''run the 'man'passwd'' command on Matrix. Unique for this college, your Linux password is changed automatically when you change your '''passwdmyseneca'''password.<br><br>#* '''NOTEQuestion:''' Do What option for the ''passwd'' command can be used to change user info (such as name)?#* '''NOTHint:''' run use the ''passwd'man''' command. Unique for this college, your Matrix password<br>is changed automatically when you change your '''mysenecapasswd''' password.<br><br><br># Press the letter <span style="font-family:courier;color:blue;font-weight:bold">q</span> key to exit the man command.<br><br> You will now learn how to perform '''command line editing'''<br>to correct syntax errors while typing Linux commands PRIOR to pressing the ENTER key.
==Command Line Editing==