Cheatography
https://cheatography.com
Reference for important directories keyboard shortcuts, & other non-command info from NOS-120. (Intended to be paired with my "Linux Commands & Options" cheat sheet.)
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Keyboard Shortcuts
Shortcut |
What It Does |
|
Show all commands that start with "abc" |
Esc + . |
Insert last argument entered (repeat to go back to previous arguments) |
Up Arrow |
Auto-fill last command entered (repeat to go back to previous arguments) |
Ctrl+Arrow (Right/Left) |
Move to beginning/end of a word |
Ctrl+Shift+T |
Open new terminal tab |
Ctrl+L |
Clear terminal output |
Ctrl+D |
Logout / Exit |
Important Directories & Files
Directory/File |
(Stands For) Purpose |
/root |
Root user's home directory |
/home |
Normal users' home directories |
/var |
(Variables) Database locations, spool files for mail, etc. |
|
/usr |
(User System Resources) System resources used by users |
— /usr/bin |
(Binaries) Executables usable by normal users |
— /usr/sbin |
(System Binaries) Executables only usable by root user |
— /usr/lib |
52-bit libraries |
— /usr/lib64 |
64-bit libraries |
|
/etc |
(Extended Text Configurations) Config files |
— /etc/passwd |
User account config files |
— /etc/group |
Group membership info & config files |
— /etc/shadow |
User password info & configs |
— /etc/sudoers |
Main file for sudo config |
— /etc/sudoers.d/ |
Destination for sudo config "drop-in files" |
— /etc/login.defs |
Defines default properties used for new user accounts |
Process States
Running |
|
currently using CPU |
Runnable |
|
queued & waiting for CPU time |
Sleeping |
|
defined (has PID) but not requesting CPU time |
|
not counted when calculating load |
|
(not yet addressed) |
|
(not yet addressed) |
|
Stopped |
|
defined (has PID) but prevented from getting CPU cycles |
|
|
Wildcards & Shortcuts
Wildcard |
What It Represents < Example > |
|
Current user's home directory |
|
The directory you're currently in |
|
Parent directory of your current directory |
|
All files in current directory < ls i*
= all files starting with "i" > |
|
"Any character" < f??e
= anything with 4 chars that starts with f
and ends with e
> |
|
Match to any one of the enclosed characters < c[aou]t
= "cat", "cot", & "cut" > |
|
"Last command run" < sudo !!
= rerun last command as root > |
|
Rerun last command but replace x with y< ^usr^tmp
after running ls /usr
will run ls /tmp
> |
|
Rerun 3rd command from command history |
|
Run most recent command with "ls" in it |
vim Editor Controls
--- Command Mode --- |
o |
Starts new line and switches to Insert mode |
cw |
"Change word" - deletes word and switches to Insert mode |
G |
Go to end of file |
dd |
Delete or cut entire line |
yy |
Copy entire line |
p |
Paste copied text |
x |
Delete character cursor is on top of |
dw |
Delete word cursor is on top of |
d$ |
Delete from cursor to end of line |
ZZ |
Save & quit (existing files) |
--- Extended Command Mode --- |
:w filename |
Save (new files) |
:wq |
Save & quit (existing files) |
Process Signals
Number/Name |
Stands For |
What It Does |
|
Hang Up |
toss current config file in memory & reload it from the file system |
|
Kill it dead! |
immediately end process that isn't responding to "terminate" signal |
|
Terminate |
shut down process (default used by kill
command) |
|
Continue |
resume allowing process to get CPU time ("unstop") |
|
Stop |
suspend process & prevent from getting CPU time |
|