Command Line Interface Flashcards

1
Q

Set Command

A

view all env variables in command shell

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

Where Command

A

find executables within the PATH variable

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

Echo Command

A

repeat things

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

Dir Command

A

look at folder contents

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

Type Command

A

output contents of a file

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

Findstr Command

A

Windows grep

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

Hostname

A

system hostname

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

date /t

A

output system date (/t keeps it from trying to set)

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

time /t

A

output system time (/t keeps it from trying to set)

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

>

A

redirect STDOUT. Create/overwrite

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

> >

A

redirect STDOUT. Create/append

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

|

A

Piping sends output of one command to input of another

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

& and ;

A

execute second command regardless of success/failure of first

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

&&

A

execute second command ONLY if the first is successful

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

||

A

execute second commmand ONLY if the first fails

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

( )

A

nest commands for complex arrangement

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

echo “Text Here”

A

prints “Text Here”

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

echo

A

shows if echo is on or off

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

echo .

A

print a blank line

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

( )

A

nest commands for complex arrangement

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

echo “Text Here”

A

prints “Text Here”

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

echo A=%A%

A

prints the new variable

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

echo .

A

print a blank line

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

@echo off

A

the @ suppresses display of the line in a batch file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
set A=4
defines a new variable
26
set A=%A%
prints the new variable
27
echo "A=%A%"
spaces are retained, as are quotes
28
echo %COMPUTERNAME%
built-in environment variable - prints the computername
29
where
find executaables within the PATH variable; are commands native to CMD
30
where dir
internal to CMD
31
where where
built into windows - tells you where the "where" command is located.
32
dir
current directory
33
dir .
current directory also
34
dir ..
parent directory
35
dir c:\
specific directory (absolute path)
36
dir /b
/b for bare, just show filenames
37
dir /s
/s subdirectories, recursive
38
dir /a:h
show hidden files
39
echo Hello > hello.txt
create a file
40
echo There >> hello.txt
append to the file, create if needed
41
type hello.txt
prints the file stated with the command
42
type
print a file, usually to the screen
43
date / time
commands to view/set date and time
44
findstr
find a substring
45
type hello.txt | findstr "There"
search for a pattern
46
type hello.txt | findstr /i “there”
/i ignore case
47
type hello.txt | findstr /r “h.*r”
regular expression (like grep)
48
type hello.txt | findstr lo
piping sends text from left into right
49
hostname
shows computer name
50
echo %COMPUTERNAME%
shows computer name
51
path
where to find executable programs
52
echo %PATH%
prints directories in your path
53
echo a & echo b & echo c
unconditional separator
54
dir hello.txt && echo exists
only do second command if first succeeded
55
dir noway.nohow || echo failed
only do second command if first failed
56
dir noway.nohow && echo failed
won't print failed, assuming the file doesn't exist
57
echo %ERRORLEVEL%
zero means success, otherwise failure code
58
Net Command
can be used to manage almost any aspect of a network and its settings including network shares, network print jobs, network users, and much more.
59
where net
find net command
60
net /?
let's see what windows can do
61
net help
how to find help
62
net help user
expanded help on user
63
net user
list of all users
64
net user admin
detailed output of admin account/local group memebership
65
net help localgroup
help for localgroup
66
net localgroup
view all local groups on computer
67
net localgroup administrators
view members of administrator group
68
net use t:\\computername\c$ /persistent:no
establish a temporary drive
69
dir t:\users
use temp drive
70
net use t: /delete
remove the t: drive label
71
wmic /?
explain global switches and aliases
72
WMIC
Windows Management Instrumentation Command line
73
wmic process /?
shows all the running processes. This is object oriented and can be sorted by headers.
74
wmic process get /all /format:list
all process details in list format
75
wmic process list brief
shows an output similar to tasklist in a legible format.
76
wmic service list brief
shows all the services that are running
77
wmic useraccount list brief
shows all the users on the machine
78
wmic nicconfig list brief
NIC information
79
wmic nteventlog list brief
list logs
80
wmic ntevent /?
query individual log entries
81
Powershell 1.0
Nov 2006 - Win XP
82
Powershell 2.0
Oct 2009 - Win 7
83
Powershell 3.0
Sep 2012 - Win 8
84
Powershell 4.0
Oct 2013 - Win 8.1
85
Powershell 5.0
Apr 2014 - Win 10
86
Cmdlets use what pattern
verb-noun
87
Powershell is what type of language
Object Oriented
88
In Powershell, external commands return as what type of data?
strings
89
Powershell commands return what type of data?
objects
90
In Powershell, an object is a data structure that contains what?
properties=data | methods=functions
91
In Powershell, external commands spawn what?
new process
92
In Powershell, internal commands run where?
inside powershell process
93
Objects
output from a powershell command
94
Classes
General term for grouped objects
95
CIM
Common Information Model
96
WMI
Windows Management Instrumentation
97
Indexes always start at?
0 (Zero)
98
Functions
A list of commands chained together to serve a purpose
99
Multithreading
A technique that allows a single set of code to be used by several processors at different stages of execution
100
Namespaces
WMI is organized into namespaces, folders that correlate products/technology
101
psinfo
shows basic system info, remote capabilities
102
pslist
shows processes in tree format
103
procmon
view, monitor, filter processes (GUI based)
104
autoruns
checks autorun registry locations
105
handle
shows handles of all processes
106
handle -p
specific process (matches partial names)
107
logonsessions
lists all currently logged in sessions
108
logonsessions -p
lists processes running in each logon sessions
109
psloggedon
more functionality regarding remote users sessions
110
tcpview
robust netstat viewer/monitor