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
what does the output of less in Bash look like?
you are launched into an interactive shell, and can see similar to more in Windows.
26
what command is an alternative to less, but has been dying in favor of less?
more
27
what are the common keys to use to interact with the less shell?
up, down, page up, page down, g, G, /word_search, q
28
What does g do in the less shell in Bash?
moves to the beginning of a file
29
what does capitol G do in the 'less' shell in Bash?
moves to the end of a file
30
what does the command /word_search do in Bash, in the less page?
allows you to search for a word or phrase
31
what can you do if you type /learning in the less page?
you will be searching the text document for the word you want to search for, in this case, learning.
32
what does q do in the less shell in Bash?
lets you quit out of less and go back to the shell
33
What does head do in Linux Shell with a text document?
shows the first 10 lines of a file by default
34
what would the command head fruit.txt print?
the first 10 lines of the fruit.txt file
35
how do you view the last 10 lines of a file in Bash?
tail
36
what will the command tail fruit.txt do?
print the last 10 lines of the fruit.txt file
37
what is one basic program you can use to edit text files with the windows gui?
notepad
38
what is a good text program to use when making configurations to scripts, configuration files, or other complex text files?
Notepad++
39
what is Notepad++?
an open source text editor with support for different file types
40
What text editor can open multiple files and tabs?
Notepad++
41
what text editor does syntax highlighting for known file types? and has advanced text editing features
Notepad++
42
what is syntax highlighting in a text editor like Notepad++?
display text in different colors, different fonts to help you categorize things
43
what did I download that i think is a programming program?
notepad++
44
what editor can I use to edit any file?
Notepad++
45
how can I edit a file from the cli?
no good default editor from PowerShell terminal, but we can launch notepad++ from the CLI and modify that way.
46
what would the command in PowerShell start notepad++ hello do?
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
what is one text editor that can be found on nearly any distribution of linux?
nano
48
how do you edit a file in nano?
type nano filename
48
what does Caret mean in the nano text editor? ^
use ctrl plus whatever letter.
49
what does get help do in nano?
opens a help page
50
what does ^X do in nano?
it lets you go back to the bash shell, brings you to a page where you can save your work and name it
51
52
what text editor thinks of itself as almost being an operating system?
emacs
53
what command on PowerShell, real PowerShell command, is used to see more information about commands?
Get-Help
54
what PowerShell command lets us look and see what the actual PowerShell command is that gets executed
Get-Alias
55
what is ls the alias for?
Get-ChildItem
56
what does Get-ChildItem do?
gets or lists the children which are the files and subdirectories of the given item
57
what happens if you run Get-ChildItem C:\
this is the same output as ls C:\
58
what commands are very long and descriptive?
PowerShell commands
59
what is a great way to work more quickly in PowerShell?
aliases
60
What are the three different types of executable commands you can use in PowerShell?
real PowerShell commands, relatable alias names, cmd.exe
61
what are commands from the old MSDOS days of Windows? Can still be run due to backwards compatibility
cmd.exe
62
What are the alias and cmd.exe versions of Get-ChildItem?
ls and dir
63
what parameter do you use to Get-Help with cmd.exe commands? PowerShell
/?
64
What is used for PowerShell commands to get help with them?
Get-Help
65
What is used to get help with other commands like dir?
/?
66
how would I use /? to get help with a command like dir?
ex: dir /?
67
what happens if you use ls /?
it will return nothing. the PowerShell command ls is alias of doesn't understand that parameter.
68
what are we using in this course? command-wise
aliases and PowerShell commands