Module 1 Day 5, Windows: display file contents, windows powershell Flashcards

1
Q

how to open a file in windows gui?

A

double click on it

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

what do text files default to open in Windows?

A

Notepad

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

how do you change the default application that opens files in Windows?

A

right click, properties, open with, select what you want it to open with instead.

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

what will most files we deal with in this course be?

A

text and configuration files

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

how to view files with PowerShell? What command?

A

cat

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

what does cat stand for?

A

concatenate

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

what command will dump the contents of the file, ‘document.txt’ into our shell, in PowerShell? It will keep writing the content until the whole file is displayed.

A

cat .\document.txt

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

how do you view the contents of a file one page at a time PowerShell? what command do you use?

A

more

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

what will the more command do?

A

get the contents of the file, and pause once it fills terminal window.

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

What command for reading text in the cli PowerShell launches you into a separate program from the shell/shelf?

A

More command.

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

what keys do you use to operate the more program?

A

enter, space, q,

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

what does the Enter key do in the More program in PowerShell?

A

advances the file by one line. Move slowly through the file.

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

what does space do in the More program in PowerShell?

A

advances the file by one page

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

what is the size of a ‘page’ in the More program?

A

It depends on the size of your terminal window

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

what does the q key do in the More program in PowerShell?

A

allows you to quit out of More and go back to the Shell

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

what command parameter do you use in PowerShell to read just the first few lines of a file?

A

-Head

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

What is the Head of the file?

A

Just the first bit of it, so you can get a glimpse of what the document is.

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

How would you use the -heads parameter to read the fruits.txt file?

A

cat fruits.txt -Head (number)

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

What will the -Head 10 parameter make the cat command do?

A

read the first 10 lines of the file.

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

What command shows us the last lines in a file?

A

-Tail

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

how do you read a simple file in Bash?

A

use the cat command to view a document

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

how would you cat document.txt in Bash? Simple, print the whole thing

A

cat document.txt

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

what command lets us view more manageable portions of a file in Bash than just cat?

A

less

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

how can I use less to read document.txt?

A

less document.txt

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

what does the output of less in Bash look like?

A

you are launched into an interactive shell, and can see similar to more in Windows.

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

what command is an alternative to less, but has been dying in favor of less?

A

more

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

what are the common keys to use to interact with the less shell?

A

up,
down,
page up,
page down,
g,
G,
/word_search,
q

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

What does g do in the less shell in Bash?

A

moves to the beginning of a file

29
Q

what does capitol G do in the ‘less’ shell in Bash?

A

moves to the end of a file

30
Q

what does the command /word_search do in Bash, in the less page?

A

allows you to search for a word or phrase

31
Q

what can you do if you type /learning in the less page?

A

you will be searching the text document for the word you want to search for, in this case, learning.

32
Q

what does q do in the less shell in Bash?

A

lets you quit out of less and go back to the shell

33
Q

What does head do in Linux Shell with a text document?

A

shows the first 10 lines of a file by default

34
Q

what would the command
head fruit.txt
print?

A

the first 10 lines of the fruit.txt file

35
Q

how do you view the last 10 lines of a file in Bash?

A

tail

36
Q

what will the command
tail fruit.txt
do?

A

print the last 10 lines of the fruit.txt file

37
Q

what is one basic program you can use to edit text files with the windows gui?

A

notepad

38
Q

what is a good text program to use when making configurations to scripts, configuration files, or other complex text files?

A

Notepad++

39
Q

what is Notepad++?

A

an open source text editor with support for different file types

40
Q

What text editor can open multiple files and tabs?

A

Notepad++

41
Q

what text editor does syntax highlighting for known file types? and has advanced text editing features

A

Notepad++

42
Q

what is syntax highlighting in a text editor like Notepad++?

A

display text in different colors,
different fonts to help you categorize things

43
Q

what did I download that i think is a programming program?

A

notepad++

44
Q

what editor can I use to edit any file?

A

Notepad++

45
Q

how can I edit a file from the cli?

A

no good default editor from PowerShell terminal, but we can launch notepad++ from the CLI and modify that way.

46
Q

what would the command in PowerShell
start notepad++ hello
do?

A

open notepad++,
ask if you want to create this file with this name, or see if you want to edit a file with this name.

47
Q

what is one text editor that can be found on nearly any distribution of linux?

A

nano

48
Q

how do you edit a file in nano?

A

type
nano filename

48
Q

what does Caret mean in the nano text editor? ^

A

use ctrl plus whatever letter.

49
Q

what does get help do in nano?

A

opens a help page

50
Q

what does ^X do in nano?

A

it lets you go back to the bash shell, brings you to a page where you can save your work and name it

51
Q
A
52
Q

what text editor thinks of itself as almost being an operating system?

A

emacs

53
Q

what command on PowerShell, real PowerShell command, is used to see more information about commands?

A

Get-Help

54
Q

what PowerShell command lets us look and see what the actual PowerShell command is that gets executed

A

Get-Alias

55
Q

what is ls the alias for?

A

Get-ChildItem

56
Q

what does Get-ChildItem do?

A

gets or lists the children which are the files and subdirectories of the given item

57
Q

what happens if you run
Get-ChildItem C:\

A

this is the same output as ls C:\

58
Q

what commands are very long and descriptive?

A

PowerShell commands

59
Q

what is a great way to work more quickly in PowerShell?

A

aliases

60
Q

What are the three different types of executable commands you can use in PowerShell?

A

real PowerShell commands, relatable alias names, cmd.exe

61
Q

what are commands from the old MSDOS days of Windows? Can still be run due to backwards compatibility

A

cmd.exe

62
Q

What are the alias and cmd.exe versions of Get-ChildItem?

A

ls and dir

63
Q

what parameter do you use to Get-Help with cmd.exe commands? PowerShell

A

/?

64
Q

What is used for PowerShell commands to get help with them?

A

Get-Help

65
Q

What is used to get help with other commands like dir?

A

/?

66
Q

how would I use /? to get help with a command like dir?

A

ex:
dir /?

67
Q

what happens if you use ls /?

A

it will return nothing. the PowerShell command ls is alias of doesn’t understand that parameter.

68
Q

what are we using in this course? command-wise

A

aliases and PowerShell commands