Module 1 Day 6: Windows searching within files, Supplemental reading for Windows PowerShell Flashcards

1
Q

in windows, how do you search for a word in a document? what hotekey

A

ctrl-f

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

how do you check if a word exists in multiple files in Windows? GUI

A

Windows Search Service

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

What indexes files on your computer by looking through them on a schedule.

A

Windows Search Service

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

What service on Windows compiles a list of names and properties of the file into a database?

A

Windows Search Service

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

what service that compiles names and properties into a database is usually disabled on Windows Servers?

A

Windows Search Service

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

What is Windows Search Service usually enabled on for files in the home directory, but not the entire hard drive?

A

Windows 8 and Windows 10 desktop computers

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

What can you find files based on in Windows Search Service?

A

name, path, last time modified, size, other details

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

What can’t you do with Search service by default? windows

A

search for words inside of files.

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

what can you configure Windows Search Service to do?

A

search file contents and their properties

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

Why is it that Windows Search Service is not configured to search file contents and properties by default?

A

it increases the time it takes for the indexer to work.

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

What does the Search Service do ahead of time?

A

runs processes, finds the information for you, and then you just have to retrieve it.

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

How do you configure Search Service to search file contents and properties?

A

start menu, type: indexing, click indexing options, Select Users, click Advanced, select file types tab, select index properties and file contents, click OK, close out.

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

How do you configure the Windows Search Service? Where are the settings for it?

A

Indexing options in the control panel

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

When you configure Windows Search Service, will all search terms you want access to be available and all files be indexed the way you want immediately?

A

no, it takes some time.

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

what will Windows do as soon as you have finished configuring Search Service?

A

it will begin rebuilding its index based on your new settings, could be a while or fast, depending on how large your files are.

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

what can you use in your home directory, GUI, to find files with specific words in them?

A

Windows File Explorer in home directory. Go to your home directory, and type the term you want to search in your search bar.

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

how can you tell if indexing is complete?

A

Indexing Options will show you.

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

what is another service you can use to find files with words in them?

A

Notepad++

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

How do your search files for words in notepad++?

A

in Notepad++, press CTRL+SHIFT+F to open the Find in files dialog. Find What: word. Directory: Users. Search.
This is very time-consuming unless you get more specific.

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

In Notepad++, when searching,
What is something you can search the name of?
where can you limit your search to?
what can you use a set of to find files?
what can you set notepad++ to replace in files?

A

specify what files you want to search,
limit search to a directory,
set of file extensions,
replace words with other words, editing the file.

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

how can you search files for words from the command line PowerShell? what command do you use?

A

sls

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

what does sls do? PowerShell

A

find words or other strings of characters and files

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

what does sls stand for? PowerShell

A

Select-String

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

what are strings?

A

a way for the computer to represent text

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

what command searches for text that matches a pattern you provide? PowerShell

A

sls

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

what sorts of patterns could you provide to the sls command PowerShell?

A

word, part of a word, phrase, more complex patterns that are described using a pattern matching language called Regular Expressions

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

What are Regular Expressions?

A

A sequence of characters that specifies a match pattern in text.

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

what is the format for the sls command to find words in files? to tell you the file and line number in the file where it was found?

A

Select-String word document

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

how would you use wildcard in PowerShell to find multiple files with a keyword? text files with the word in it.

A

Select-String ‘word’ *.txt

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

what command parameter on PowerShell with sls can you use to just look up things in a directory?

A

-Filter

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

How would I use the command parameter -Filter? look for .exe in C:\Program Files

A

ls ‘C:\Program Files' -Recurse -Filter *.exe

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

what will the -Filter parameter filter?

A

the results for file names that match a pattern

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

what does the asterisk mean?

A

match anything

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

What is .exe?

A

the file extension for executable files in Windows

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

how can we search for words in files that match a certain pattern? command in Linux

A

grep

35
Q

how to find out if a file is in a directory or a word is in a file? Linux

A

grep

36
Q

what would the command:
grep cow farm_animals.txt
do?

A

search for the word cow in the file farm_animals.txt, and pull it up with it highlighted in red. It shows you if it found the word in the file.

37
Q

how can you use grep to search multiple files? search for the word cow in any files that end in _animals.txt

A

grep cow *_animals.txt

38
Q

what will
grep cow *_animals.txt
show?

A

in all _animals.txt files, it will show if the word cow is in the document.

39
Q

what is echo an alias for?

A

Write-Output

40
Q

on a surface level, what does the echo command do?

A

prints out our keyboard input to the screen

41
Q

what does I/O streams mean?

A

input/output streams

42
Q

how many streams does each process in Windows have?

A

three

43
Q

what is stdin?

A

standard in

44
Q

What is stdout?

A

standard out

45
Q

what is stderr?

A

standard error

46
Q

how do you provide input to a process?

A

add things to the standard instream, which flows into the process.

47
Q

what creates output?

A

the process, when it adds data to the standard out stream.

48
Q

what stream does the data you input into the CLI go to?

A

the standard in stream for the process you interact with

49
Q

how does a process communicate with you?

A

puts data into the standard out stream

50
Q

what does the CLI write?

A

data from the standard out stream

51
Q

what symbol do you use to put the standard output information in a file instead of putting it in the PowerShell CLI?

A

> , the greater than symbol

52
Q

what do we call the >?

A

a redirect, operator, that lets us change where we want our standard output to go. I can send to file, instead of the screen, for example.

53
Q

what should I think of data streams as?

A

actual streams of information.

54
Q

what will the > do if you direct echo to write to a file?

A

if the file exists, it will overwrite it for us. Otherwise, it will make a new file.

55
Q

what do you do if you don’t want > to overwrite an existing file?

A

use the command “””»,”” which means -Append

56
Q

how would I make a file, using the echo and > commands called dog.txt which says woof?

A

echo woof > dog.txt

57
Q

how would I add to a document called dog.txt, and make it say an additional woof?

A

echo woof&raquo_space; dog.txt

58
Q

what if you want to send the output of one command to the output of another command?

A

the pipe operator

59
Q

how would I lift the words that just contain the string st from a file called words.txt

A
cat words.txt | Select-String st
60
Q

Take all the words from the file called words.txt, starting with st, and put them into a file called st_word.txt.

Hint:
display the contents of a file called words.txt. Next, you want to take all the words from that file that start with st, and put that into a file called st_word.txt

A
cat words.txt | Select-String st > st_word.txt
61
Q

if you don’t want to see errors, how can you redirect them in a different output stream?

A

standard error.

62
Q

what does
rm secure_file 2> errors.txt
do?

A

makes you a file called errors.txt, and then you can see the error message from before.

63
Q

what does the 2 mean in
rm secure_file 2> errors.txt?

A

all of the output streams are numbered, and this is the number for the standard error output. one is for standard out, instead.

64
Q

what does 2> mean?

A

we are telling PowerShell to redirect the standard error stream to the file instead of out.

65
Q

how can you filter error messages? what command can you use?

A

$null

66
Q

what is $null?

A

nothing. a redirection black hole.

67
Q

how do you redirect error message for
rm secure_file to $null?

A

rm secure_file 2> $null

68
Q

do this later: PowerShell

A

Get-help about_redirection

69
Q

what are the three linux streams?

A

stdin
stdout
stderr

70
Q

what does
echo woof > dog.txt
do in linux bash?

A

make a file that says woof called dog.txt

71
Q

what does the&raquo_space; operator do in Linux?

A

appends to a file instead of overwriting

72
Q

what is format for append or greater than?

A

echo input >(>) filename.txt

73
Q

in redirector?

A

<

74
Q

how to use the standard in redirect operator to get input from files?

A

cat < file_input.txt

75
Q

what does
cat < file_input.txt
do in linux?

A

the same thing as cat file_input.txt, only we aren’t using keyboard input, we are using the file as standard in.

76
Q

how do you redirect just the error messages of some output in linux? make a document called error_output.txt. to get the error, list directory /dir/fake_dir.

A

ls /dir/fake_dir 2> error_output.txt

77
Q

what is the Linux nullifying black hole?

A

the /dev/null file

78
Q

how to see the standard messages only, filtering out the errors in a file to null, and look at var/log/syslog? in

A

less /var/log/syslog 2> /dev/null

79
Q

how can you see which sub-directories in the /etc directory contain the word Bluetooth? use the pipe redirected to take the output of ls -la /etc and send it to the grep command.

A

ls -la /etc | grep bluetooth

80
Q

what are used to help you do advanced pattern-based selection?

A

Regular expressions

81
Q

https://learn.microsoft.com/en-us/shows/getting-started-with-microsoft-powershell/

A

getting started with Microsoft PowerShell

82
Q

PowerShell for every system

A

https://github.com/PowerShell/PowerShell

83
Q

What does unbalanced sugar do?

A

Kills me

84
Q

what is /r[aeiou]+/g an example of?

A

a regular expression sequence that will get you all characters matching the pattern, lowercase r followed by one or more lower-case vowels.

85
Q

what is the shortening of regular expression?

A

regex

86
Q

what is the grep command derived from?

A

g/re/p: global search for regular expression and Print matching lines.