Goals: Introduction to using a Terminal
What does a prompt look like?
General syntax of shell command.
Commands/options are case sensitive.
Getting Help:
Man pages (
man
)Options:
<command> --help
...
Table of Contents | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Login
Open up Chrome
Navigate to: MedicineBow OnDemand
Type in your provided username and password. Usually this will be your UWYO username and password, unless you are using an assigned training account.
Authenticate using your preferred 2 factor method (expandable directions below):
Expand | ||
---|---|---|
| ||
If you usually get a two-factor push to your phone, just hit enter after entering your username and password, then complete authentication by approving the push on your device. |
Expand | ||
---|---|---|
| ||
Without hitting enter after typing in your username and password, in the password text box, append a comma (,) to the end of your password, then append phone as shown in the screenshot below: You should get a phone call on your main phone # associated with your two factor account. Answer this call and hit # to approve access. |
Expand | ||
---|---|---|
| ||
If you prefer to use a 2 factor passcode from your Duo Mobile app, without hitting enter after typing in your username and password, in the password text box, append a comma (,) to the end of your password, then append the multi digit passcode found in duo mobile as shown in the screenshot below: |
Expand | ||
---|---|---|
| ||
Type in the account password, then, without hitting enter, append a comma (,) to the end of the password, then touch the light on the yubikey as shown in the screenshot and photo below: Then hit the green light on your yubikey to authenticate: |
...
Start MedicineBow Shell Access
Excerpt | |||
---|---|---|---|
| |||
...
The Command-Line Prompt
...
Your Prompt
Note |
---|
From now on, your prompt will take the form: where:
|
...
Syntax of a Shell Command
...
Linux IS Case Sensitive
Info |
---|
In Linux, commands, options, folder, filenames… are Case Sensitive. |
Code Block |
---|
# Lists what is in the current location.
[<username>@<hostname> ~]$ ls
Desktop Documents Downloads
# Throws an error.
[<username>@<hostname> ~]$ LS
-bash: LS: command not found
Filename ≠ FiLeNaMe ≠ FILENAME |
Note |
---|
Remember: |
...
Getting Help: man
Info |
---|
Linux has a number of ways to find help on commands. The first is man - “manual”. |
Code Block |
---|
[<username>@<hostname> ~]$ man ls
LS(1) User Commands LS(1)
NAME
ls - list directory contents
SYNOPSIS
ls [OPTION]... [FILE]...
DESCRIPTION
List information about the FILEs (the current directory by default). Sort entries alpha‐
betically if none of -cftuvSUX nor --sort is specified.
Mandatory arguments to long options are mandatory for short options too.
-a, --all
do not ignore entries starting with .
-A, --almost-all
do not list implied . and ..
...
Manual page ls(1) line 1 (press h for help or q to quit) |
...
Getting Help: <command --help>
Info |
---|
The next method is to use a command's |
Code Block |
---|
[<username>@<hostname> ~]$ ls --help Usage: ls [OPTION]... [FILE]... List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuvSUX nor --sort is specified. Mandatory arguments to long options are mandatory for short options too. -a, --all do not ignore entries starting with . -A, --almost-all do not list implied . and .. --author with -l, print the author of each file -b, --escape print C-style escapes for nongraphic characters --block-size=SIZE with -l, scale sizes by SIZE when printing them; e.g., '--block-size=M'; see SIZE format below -B, --ignore-backups do not list implied entries ending with ~ ... |
...
Getting Help: Options
Info |
---|
Typically, options can have a:
Short options can be grouped:
|
...
Single vs Multiple Lines
Info |
---|
If you have a long command, which is difficult to read over a single line, you can split it up across multiple lines. To split, at the end of the line where you want to split type You can continue to split across multiple lines. Once you’re ready to execute, simply press |
Code Block |
---|
[<username>@<hostname> ~]$ ls -al ~
[<username>@<hostname> ~]$ ls \
> -al \
> ~ |
...
Exercises
Info |
---|
Questions:
|
...
Answers(1)
1: Is there a difference between running ls
versus ls -al
?
Expand | ||
---|---|---|
| ||
Yes. The The characters after the '
|
...
Answers(2)
2: How would you find out what the –al
options do?
Expand | ||
---|---|---|
| ||
|
...
Answers(3, 4)
3: What does the pwd
command do?
Expand | ||
---|---|---|
| ||
|
4: From the command line, what happens if you press the up/down arrow keys?
Expand | ||
---|---|---|
| ||
Steps through the previous commands you’ve typed. What do you find? This should access your previous commands. Hitting the up arrow once will give you the last command you typed in. Pressing it over again will produce the command that preceded that one, and so on. |
...
Previous | Workshop Home |
Next |
...
...