Lesson 7 - Chapter 1: Introducing the Command Line Interface Flashcards

1
Q

What does CLI stand for?

A

Command-Line Interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a CLI?

A

a text-based interface app that sends typed commands to the command interpreter (shell)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a command interpreter also called?

A

Shell

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Do all the different OS CLI accept the same commands?

A

No, but Linux and macOS accept similar commands

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the (at least) 2 CLIs that Windows 10 and 11 have?

A
  1. Command Prompt
  2. PowerShell
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What’s the executable file for Command Prompt?

A

cmd.exe

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the “Terminal” in Win11?

is a…. that can…

A

The Terminal is a container that can run multiple CLIs on its own, different tab

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a “container”?

A

a lightweight piece of software

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you open a new tab in Terminal and choose its CLI in Win11?

A

You click the down arrow in the tabs area, click the CLI you want

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you get to the Terminal in Win11 quickly?

A

Win + X or Right-Click the Start button, select Terminal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you set a default CLI in Win 11 to Command Prompt? [in Command Prompt]

5 steps

A
  1. Have the desired CLI open in the tab
  2. Settings
  3. Set “Default Terminal Application” to “Windows Console Host”
  4. Set “Default Profile” to “Command Prompt”
  5. Save
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you quickly open a CLI tab in Terminal in Admin mode?

A

Ctrl right-click as you click the desired CLI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

The macOS Terminal app accepts most of the same commands as…?

A

Linux

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you get to the Terminal in macOS?

A

Finder > Applications > Utilities > Terminal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In a Linux command prompt, what does using the prefix “sudo” and “su” do? (2)

A

sudo = elevated privileges for the Linux command prompt
su = elevated privileges for the entire session

It’s the Linux version of running in Admin mode (except the app isn’t run in Admin mode it’s set by the user running the command)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What’s the difference between Command Prompt and command prompt?

A
  1. Command Prompt is the CLI name
  2. command prompt is the spot in the CLI where you type
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What does “working directory” refer to?

A

Working directory = the current location

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Can you customize the command prompt?

A

Yes, Power Users usually do

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is the default prompt for Windows CLI?

A

It shows the complete path to the working directory (including drive letter)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is the default working directory in Windows 11?

A

the default working directory in Win 11 CLIs is the user’s personal directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What does the Linux and macOS CLI command prompt show? (3)

A
  1. Current location (working directory)
  2. Current User
  3. System Name
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What does > indicate in a Windows command prompt?

A

it means the end of the command prompt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

For a Linux Terminal, what indicates the end of the prompt?

A

$ means the end of the command prompt for Linux

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

In Linux, what’s shorthand for the user’s home directory?

A

~ is shorthand for the user’s home directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What does the “home directory” in Linux refer to?

A

the top-level directory to which the user has access

(roughly similar to Windows’s personal directory default)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Do you use drive letters in Linux Terminal app prompts?

A

No, drive letters don’t exist (for Linux and macOS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Since drive letters don’t exist for Linux and macOS, how do multiple physical disks show up on those systems? (2)

A
  1. Linux = mounted in /mnt or /media/username
  2. macOS = mounted in /Volumes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Because macOS and Linux don’t use drive letters, how are the drives mounted?

A

the drives are mounted logically to the existing directory tree

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What does the “cd” command do?

A

Changes the focus of the command prompt to another directory
(Change Directory)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

Which OS does the “cd” command work in? (3)

A
  1. Windows
  2. Linux
  3. macOS
31
Q

When using cd, if the desired directory is a sub-directory of the current one what can you do?

A

You can use shorthand of the directory name (Public, for example, without a slash) to cd into that sub-directory

32
Q

When would you need to use the backslash on a directory in a command prompt for Windows when changing directory?

A

When changing to a directory that’s not a sub-directory

33
Q

What does the command prompt look like when using cd to go from Users down to the Public directory? (Windows)

A

c:\Users>cd Public

(shorthand because it’s a sub-directory)

34
Q

What does the command prompt look like when using cd to go from Users to the Windows directory (not a sub-directory)?

A

c:\Users>cd \Windows

(need to add the backslash for non sub-directories)

35
Q

What does the “root directory” mean? (Windows)

A

The root directory is the top-level directory in the hierarchy

(like c:)

36
Q

To go from the root directory to the Public directory under Users, what does the command prompt look like? (Windows)

A

c:>cd \Users\Public

(the full path from the c:\ root top-level directory)

37
Q

How do you go back up «one level» in the hierarchy in the command prompt when trying to go from C:\Windows\System32 to C:\Windows?

A

c:\Windows\System32>cd ..

38
Q

What’s the command prompt to go back to the root directory from the Windows directory?

A

c:\Windows>cd \

39
Q

What would you use in the Windows command prompt to go back to the root directory as a shortcut?

A

backslash

by itself c:\Windows>cd \

40
Q

Linux: to go from the user’s home directory ~ to a sub-directory, what can you use?

A

you can just use the directory name

vanesa@Ubuntu:~$cd Documents

41
Q

Linux: How do you go from a sub-directory of vanesa’s home directory (Documents) to another directory within vanesa’s home directory (Downloads)? (prompt)

A

vanesa@Ubuntu:~/Documents$cd ~/Downloads

(need the ~ and a forward slash)

42
Q

Linux: To go from the home directory to ~/Documents/Jedi, what would the prompt look like?

A

vanesa@Ubuntu:~$cd ~/Documents/Jedi

(needs the full path)

43
Q

Linux: To go back up one level in the hierarchy, what do you use?

A

2 dots just like Windows

44
Q

Linux: How do you go back to the root directory from “Documents”?

A

vanesa@Ubuntu:~/Documents$cd ~

(you use the ~ root directory shortcut to go back to root directory)

45
Q

What indicates the end of a prompt for Windows and Linux? (2)

A

Windows = >
Linux = $

46
Q

How do you change to another drive letter in the Windows CLI?

A

change to focus to another drive by typing the target drive letter with a colon

d: or D:

47
Q

Which OS’s CLI is case-sensitive for paths? (2)

A

Linux and macOS

48
Q

Are Windows paths case-sensitive?

A

No

49
Q

On Linux, are ~/desktop and ~/Desktop the same directory?

A

No, they’re different directories hence why Linux is case-sensitive

50
Q

Commands require proper ____

A

syntax

51
Q

What is syntax?

a, s, p

A

the combination of arguments, switches, and parameters that follow the command

52
Q

How do you switch the default CLI when right-clicking the Start menu in Windows?

A

Right-click the taskbar > taskbar settings > toggle off “Replace Command Prompt with Windows PowerShell in the menu when I right-click the start button or press Windows + X”

53
Q

How does the default prompt differ on Windows and Linux/macOS?

A

Windows = Shows the complete path to the working directory
Linux/macOS = Shows the working directory, current user, and system name

54
Q

What do commands use arguments for?

A

Arguments are used by commands to collect input that’s placed into variables [it’s basically the details]

(like which directory to change to would be the argument)

55
Q

What are switches also called?

A

options

56
Q

What are switches?

A

they’re codes that specify how the command should process the input

(also called options)

57
Q

How do (short form) switches usually look like? (2)

A
  1. Usually preceded by a slash (/f)
  2. Usually preceded by a dash (-h)
58
Q

Each switch may have 3 forms:

A
  1. Short form with 1 hyphen or forward slash (-v or /?)
  2. Long form with 2 hyphens (–help)
  3. Both
59
Q

Which switch form is sometimes case-sensitive?

A

Short forms

60
Q

Can short switches be combined?

A

Yes, to change multiple options at once

(ls -la for example)

61
Q

What happens if you use switches that don’t make sense together? (2)

A
  1. Command fails
  2. Command silently ignores some options
62
Q

What is a parameter?

A

an argument (detail) that’s associated with a switch (how to process command)

(-f Notes or file=Notes)

63
Q

What do the 2 forms that a switch associated with a parameter would look like? Long and short (2)

A
  1. Short-form switch - a space before parameter (-f Notes)
  2. Long-form switch - a = between (file=Notes)
64
Q

On Windows, how do you view the syntax documentation for almost any command? (2)

A
  1. help command
  2. /? switch
65
Q

In Terminal, how do you view syntax documentation for almost any command? (2)

A
  1. man (manual) command
  2. -h switch(not working for me on Ubuntu)
66
Q

How do you request documentation on the cd command? (2) Windows and Linux

A
  1. help cd (Windows)
  2. man cd (Linux)

(both have a primary argument that requests documentation on a topic)

67
Q

When viewing syntax documentation for a command, optional arguments and switches appear in….?

A

brackets

(but you don’t type them with brackets in the command line)

68
Q

Switches are nearly always…. ?

A

optional

69
Q

For some commands, is the order of the items important?

A

Yes

70
Q

How should you place the order of the syntax?

A

in the order shown in the help system (switches order usually doesn’t matter but some may need to be placed before/after a required argument)

71
Q

Required arguments don’t have ____ around them (in the syntax documentation)

A

brackets

72
Q

How do mutually exclusive switches appear in the syntax documentation (using /? for example) ?

A

they appear within a single set of brackets with a pipe symbol between them

ex [/A | /B]

73
Q

What does it mean when something is mutually exclusive?

A

they can’t happen at the same time

(either A OR B)