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
Q

set A=4

A

defines a new variable

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

set A=%A%

A

prints the new variable

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

echo “A=%A%”

A

spaces are retained, as are quotes

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

echo %COMPUTERNAME%

A

built-in environment variable - prints the computername

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

where

A

find executaables within the PATH variable; are commands native to CMD

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

where dir

A

internal to CMD

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

where where

A

built into windows - tells you where the “where” command is located.

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

dir

A

current directory

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

dir .

A

current directory also

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

dir ..

A

parent directory

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

dir c:\

A

specific directory (absolute path)

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

dir /b

A

/b for bare, just show filenames

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

dir /s

A

/s subdirectories, recursive

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

dir /a:h

A

show hidden files

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

echo Hello > hello.txt

A

create a file

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

echo There&raquo_space; hello.txt

A

append to the file, create if needed

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

type hello.txt

A

prints the file stated with the command

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

type

A

print a file, usually to the screen

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

date / time

A

commands to view/set date and time

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

findstr

A

find a substring

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

type hello.txt | findstr “There”

A

search for a pattern

46
Q

type hello.txt | findstr /i “there”

A

/i ignore case

47
Q

type hello.txt | findstr /r “h.*r”

A

regular expression (like grep)

48
Q

type hello.txt | findstr lo

A

piping sends text from left into right

49
Q

hostname

A

shows computer name

50
Q

echo %COMPUTERNAME%

A

shows computer name

51
Q

path

A

where to find executable programs

52
Q

echo %PATH%

A

prints directories in your path

53
Q

echo a & echo b & echo c

A

unconditional separator

54
Q

dir hello.txt && echo exists

A

only do second command if first succeeded

55
Q

dir noway.nohow || echo failed

A

only do second command if first failed

56
Q

dir noway.nohow && echo failed

A

won’t print failed, assuming the file doesn’t exist

57
Q

echo %ERRORLEVEL%

A

zero means success, otherwise failure code

58
Q

Net Command

A

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
Q

where net

A

find net command

60
Q

net /?

A

let’s see what windows can do

61
Q

net help

A

how to find help

62
Q

net help user

A

expanded help on user

63
Q

net user

A

list of all users

64
Q

net user admin

A

detailed output of admin account/local group memebership

65
Q

net help localgroup

A

help for localgroup

66
Q

net localgroup

A

view all local groups on computer

67
Q

net localgroup administrators

A

view members of administrator group

68
Q

net use t:\computername\c$ /persistent:no

A

establish a temporary drive

69
Q

dir t:\users

A

use temp drive

70
Q

net use t: /delete

A

remove the t: drive label

71
Q

wmic /?

A

explain global switches and aliases

72
Q

WMIC

A

Windows Management Instrumentation Command line

73
Q

wmic process /?

A

shows all the running processes. This is object oriented and can be sorted by headers.

74
Q

wmic process get /all /format:list

A

all process details in list format

75
Q

wmic process list brief

A

shows an output similar to tasklist in a legible format.

76
Q

wmic service list brief

A

shows all the services that are running

77
Q

wmic useraccount list brief

A

shows all the users on the machine

78
Q

wmic nicconfig list brief

A

NIC information

79
Q

wmic nteventlog list brief

A

list logs

80
Q

wmic ntevent /?

A

query individual log entries

81
Q

Powershell 1.0

A

Nov 2006 - Win XP

82
Q

Powershell 2.0

A

Oct 2009 - Win 7

83
Q

Powershell 3.0

A

Sep 2012 - Win 8

84
Q

Powershell 4.0

A

Oct 2013 - Win 8.1

85
Q

Powershell 5.0

A

Apr 2014 - Win 10

86
Q

Cmdlets use what pattern

A

verb-noun

87
Q

Powershell is what type of language

A

Object Oriented

88
Q

In Powershell, external commands return as what type of data?

A

strings

89
Q

Powershell commands return what type of data?

A

objects

90
Q

In Powershell, an object is a data structure that contains what?

A

properties=data

methods=functions

91
Q

In Powershell, external commands spawn what?

A

new process

92
Q

In Powershell, internal commands run where?

A

inside powershell process

93
Q

Objects

A

output from a powershell command

94
Q

Classes

A

General term for grouped objects

95
Q

CIM

A

Common Information Model

96
Q

WMI

A

Windows Management Instrumentation

97
Q

Indexes always start at?

A

0 (Zero)

98
Q

Functions

A

A list of commands chained together to serve a purpose

99
Q

Multithreading

A

A technique that allows a single set of code to be used by several processors at different stages of execution

100
Q

Namespaces

A

WMI is organized into namespaces, folders that correlate products/technology

101
Q

psinfo

A

shows basic system info, remote capabilities

102
Q

pslist

A

shows processes in tree format

103
Q

procmon

A

view, monitor, filter processes (GUI based)

104
Q

autoruns

A

checks autorun registry locations

105
Q

handle

A

shows handles of all processes

106
Q

handle -p

A

specific process (matches partial names)

107
Q

logonsessions

A

lists all currently logged in sessions

108
Q

logonsessions -p

A

lists processes running in each logon sessions

109
Q

psloggedon

A

more functionality regarding remote users sessions

110
Q

tcpview

A

robust netstat viewer/monitor