Please enable JavaScript.
Coggle requires JavaScript to display documents.
Using the Command Line - Coggle Diagram
Using the Command Line
Stuff from other chapters that needs to be relocated
reg
Full registry editor
regsvr32
adds dynamic link libaries
what are those?
DLL
netstart
netstart <service name>
starts a service
netstop
netstop <service name>
stops a service
tasklist
view running processes
taskkill
kills a process
how is this different from netstop?
FDISK
Permissions in Linux/mac
How do you list files with permissions?
<owner permissions > <group permissions> <all users permissions > <links> <owner> <group name> <file size> <date> <time> <file name>
In that order
Permission abbreviations
R
Read
W
Write
Modify
X
Execute
List file contents
What are links used for?
Chown
Change owner
Change group
chown <new owner> <file name>
chown <owner> : <group> <file name>
Chmod
Change permissions
chmod <permissions numbers> <file name>
Permission numbers
3 digits
_00
Owner permissions
0_0
Group permissions
00_
All users permissions
R
4
W
2
X
1
For each permission add up what you want them to have
Who can run this?
chkdsk
Fdisk
Format
fsck
Reason to use
Speed
Little Processing power
Add to script
Scripting
Small program written to automate tasks
languages
shell scripting
Windows specific
batch file
.bat
old school
command shell
DOS
Comments
REM
old
::
Power shell
.psl
Modern windows
replaces .bat
Coments
hashtag
Unix shell script
.sh
Universla
comments
hashtag
General
python
.py
Simple syntax
Very flexible
comments
Hashtag
Java Script
.js
used by web browsers
comments
//
single line
/
<>
/
multiline
Visual Basic
.vbs
Legacy language
Is being replaced
Comments
'
anatomy
data types
Defined category of data
integer
whole number
string
sequence of characters
Variables
name data so the computer knows to remember it
you make these
Enviroment
values stored in variables of an environment
system wide
User
program
use to configure scripts without having to edit it directly
conditionals
code that wont run if a condition is met
loops
run code until a condition is or is not met
Comments
text that the you read not the computer
used for clarification
Shells
interpreter between the Command Line and The OS
Windows
Command Prompt
PowerShell
Mac/Linux
Bash
Literally Anything Else
Each OS can support Multiple
Questions
what is <DIR>?
is there any switches there any uniformity to the switches?
What are the switches for the commands
How to do a relative path?
once a folder is mounted what happens when that drive is removed?
What happens if in linux/mac the drives have the same name?
what is a directory?
how is it diffrent from a folder?
how are they denoted on the HDD fromat?
What is THE PATH?
How does it work?
do you have to use ./ every time you use an executable or just the first time you run it?
what are all the switches
What does the ? do
windows equivalent of Copy and move?
What does gpupdate do?
What does sfc do?
Syntax for all commands?
what in windows shows the history of commands?
Diffrence between itconfig and iwconfig
What is a Process ID?
How to use grep?
How to use apt-get?
How to use environment variables?
Advanced Privileges
Windows
Right click> run as Administrator
Linux/Mac
su/sudo Command
How it Works
Focuses on the Current Directory
File names
Filename.extention
Filename
You chooes this
what usually shows up
Windows cannot contain
*
"
/\
;
:
|
=
,
Linux/mac cannot contain
/
Extention
marks the file format
How the program organizes its Binary Information.
PC gives this part ususally
Dosnt usually show up
executables
Windows
.exe
.com
Linux/mac
anything with the attribute clicked
2 types
Builtin
Type and go
Comes with the OS
executable
Downloaded
use ./ in front when running
The Path
Collection of folders
Different from a file path
commands
Do what you say not what you mean
Check twice execute once
Syntax
The way to write a command
Switches
Extra Numbers/ letters
Changes an aspect of a command
-[number/letter]
put spaces between commands and switches
Windows
Basic
[command Name] /?
Shows syntax of that command
dir
Contents of working directory
md
makes directories
rd
does not have a confirmation message
only works if empty
removes directories
switches
s
deletes subfolders and directories
chkdsk
scans detects and repairs hard drive issues
switches
f
fix file
r
locate and repair bad sectors
Format
Format volumes
hostname
displays current computers name
gpupdate
sfc
Not case sensitive
Files
del
Deletes Files
Not retrievable without special Tools
Switches
s
Deletes all folder and all containing files
Xcopy
Works with multiple directories
Switches
s
Copy everything except whats empty
e
Copy empty
robocopy
File copier
robocopy [source] [destinations] [switches]
Switches
mir
take everything
Linux/mac
Basic
man [command name]
Shows the syntax of that command
Called manual pages
Press Q to quit
ls
contents of working directory
switches
-l
Detailed info
rm
removes directories
switches
r
deletes everything
itconfig
view/change settings
eth
wired ethernet NIC
wlan
wireless
802.11 NIC
lo
Loopback
iwconfig
Wireless settings
ps
processes running
menu options
user
who is running it
PID
process ID
% CPU
Percent of CPU power
% mem
Percent of RAM being used
vsz
Paged memory
TTY
Whats using the output
Stat
S
Waiting
R
running
l
multithread
t
Foreground
START
When the process started
TIME
How long its been running
Command
name of the executable
case sensitive
Linux only
/mnt
Drives Directory
/media/[username]
removable drives Directory
Package managers
apt-get
APT
Advanced package tool
RPM
Red hat package manager
Download software
install software
Update software
Mac Only
/volumes
Drives Directory
Files
rm
deletes files
not retrievable
Switches
r
Deletes folder and all contents
cp
Copy
mv
move
grep
Search text files
Search command outputs
filter command outputs
vi
default text editor
2 modes
Insert
inset text
edit text
Command
Default
i
insert left of cursor
ESC
escape command
ZZ
Save and quit
Delete
D
Delete the portion of the current line to the right of current character
dd
Delete current line
X
delete current character
Move cursor
h
one character to the left
j
one line down
w
one word to the right
k
one line up
l
one character right
b
one word to the left
0
beginning of line
$
end of the line
r
change current character
q!
Quit without saving
dd
Create exact image of a block of storage
dd if = [source] of = [destination]
passwd
change your password
All OS
|
[command 1] | [Command 2]
called a pipe
Takes the output of one command into the input of another
cd [path]
Changes Directroy
Path
exact
starts at root
relative
starts from current directory
..
Moves up a directory
mkdir
creates directories
rmdir
removes directories
WildCards
Used in place of a name of a file/folder
*
I don't care what character is here
?
Copy/Move process
Step 1 point Command Prompt to a directory containing files you want to copy/move
Step 2 type the command the put a space
Step 3 type the name(s) of the files(s) then put a space
Step 4 type the path of the new location
Step 5 hit enter
Pruning
Grabs a folder with all sub-folders and moves them
Shutdown
Turns off computer
Error Messages are your Friend not your Enemy