Chapter 15: Command Line Interface Flashcards

1
Q

CLI

A

Command Line Interface

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

Shell

A

Command line interpreter program

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

\

A

backslash (Windows)

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

/

A

forward slash (UNIX)

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

sudo; su

A

Super user privileges in UNIX, write before your commands

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

Working Directory

A

Current directory (where terminal is focused)

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

Absolute Path

A

full file location

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

Relative Path

A

path based off a starting point

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

pwd

A

UNIX - full path

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

~

A

UNIX - home directory

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

switch

A

“options” for different commands, typically following the command

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

[command] /?

A

WINDOWS - get help on what command does (manual)

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

man [command]

A

UNIX - get help on what command does (manual)

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

builtin vs external

A

builtin - command that is part of the shell
external - command that is not innate to shell

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

type [command]

A

UNIX - gives the type of command written

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

type - a [command]

A

UNIX - gives all types of that command, not just default type

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

Get-[command]

A

WINDOWS - gives info on command

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

dir
dir /p

A

WINDOWS - shows directory contents
shows directory contents but pauses after one page

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

ls
ls | more
ls -l

A

UNIX - shows directory contents
shows contents but pasuses after one page
shows long form details on contents

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

cd \path
cd ..

A

changes directory focus
moves focus up a directory (to parent)

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

e: (command prompt)

A

WINDOWS - switches to e: drive

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

Switching drives in UNIX

A

must look manually
MacOS - check the /Volumes
Ubuntu - check /mnt or /media/<user></user>

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

md [name]

A

WINDOWS - create a directory given name

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

mkdir [name]

A

UNIX and WINDOWS - create a directory given name

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

rd [name]

A

WINDOWS - remove directory

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

rmdir [name]

A

UNIX AND WINDOWS - remove directory

27
Q

rd [name] /s

A

WINDOWS - remove directory and all contents

28
Q

rm -r [name]

A

UNIX - remove direcotry and alll contents

29
Q

more [name]

A

WINDOWS - when in directory, writes out contents of txt file

30
Q

cat [name]

A

WINDOWS AND UNIX - when in directory, writes out contents of txt file

31
Q

wildcards

A

use * to indicate catchall spaces e.g. .pdf (all pdf files) or a (all files that start with “a”)

32
Q

del [name]

A

WINDOWS - deletes a file

33
Q

rm [name]

A

UNIX - deletes a file

34
Q

copy [name]

A

WINDOWS - copies a file

35
Q

syntax for copying/moving in WINDOWS or UNIX

A

[command] [name] [destination path]

36
Q

move [name]

A

WINDOWS - moves a file

37
Q

cp [name]

A

UNIX - copy a file

38
Q

mv [name]

A

UNIX - move a file

39
Q

xcopy

A

WINDOWS - copy bulk directories

40
Q

xcopy switches

A

/s - copy all subdirectories that aren’t empty
/e - include all empty directories

41
Q

robocopy

A

WINDOWS - Robust Copy, can copy across networks, has many functions

42
Q

Robocopy syntax and mirror switch

A

robocopy [source path] [destination path] [options]
/mir - mirror source structure

43
Q

format

A

WINDOWS - format a volume, has extensive switch options

44
Q

hostname

A

WINDOWS - show name of computer

45
Q

winver

A

WINDOWS - get version info

46
Q

gpupdate

A

WINDOWS - update group policy (force)

47
Q

gpresult

A

WINDOWS - detailed group policy

48
Q

gpresult syntax

A

gpresult /user [username] /r

49
Q

sfc

A

WINDOWS - system file check, fix corrupted files

50
Q

shutdown

A

WINDOWS - turn off machine
/r to restart

51
Q

ps aux

A

UNIX - onetime snapshot of current processes (detailed)

52
Q

top

A

UNIX - focuses on resource hungry process

53
Q

chkdsk /f /r

A

WINDOWS - scan, detect, and repair disk issues
/f - fix file errors
/r - locate and repair bad sectors

54
Q

ps vs top

A

UNIX
ps gives you snapshot of processes and details on this info
top gives you dynamic, updating, interactive info on processes

55
Q

grep

A

UNIX - search for and print text strings in a file (may need to specify path)

56
Q

find syntax

A

UNIX:
find [path] -iname “criteria”
looks for files that match criteria

57
Q

APT

A

UNIX - Advanced packaging tool, used to manipulate apps via command line in Debian family

58
Q

apt-get update

A

UNIX - Updates Ubuntu systems

59
Q

yum

A

UNIX - packaging tool used to manipulate apps via command lin in Redhat family

60
Q

nano

A

UNIX - creates a text file
nano “file” for name

61
Q

dd

A

UNIX - create an image of a drive

62
Q

df -h

A

UNIX - what diskspace is free?
-h switch creates human friendly output

63
Q

Scripting Languages

A

Batch File/.bat - old command, DOS
PowerShell/.ps1 - modern windows
bash/.sh - UNIX

Python/.py
Javascript/.js
VisualBasicScript/.vbs

64
Q

Use Cases for Scripting

A

Basic Automation
Restarting Machines
Remapping Network Drives
Installing Apps
AutoBackup
Data Gathering
Updates