Show Menu
Cheatography

Linux Info & Navigation Cheat Sheet (DRAFT) by

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
abc
Tab Tab
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 beginn­ing/end of a word
Ctrl+Shift+T
Open new terminal tab
Ctrl+L
Clear terminal output
Ctrl+D
Logout / Exit

Important Direct­ories & Files

Directory/File
(Stands For) Purpose
/root
Root user's home directory
/home
Normal users' home direct­ories
/var
(Varia­bles) Database locations, spool files for mail, etc.
 
/usr
(User System Resources) System resources used by users
— /usr/bin
(Binaries) Execut­ables usable by normal users
— /usr/sbin
(System Binaries) Execut­ables only usable by root user
— /usr/lib
52-bit libraries
— /usr/lib64
64-bit libraries
 
/etc
(Extended Text Config­ura­tions) 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/sudoe­rs.d/
Destin­ation for sudo config "­drop-in files"
— /etc/login.defs
Defines default properties used for new user accounts

Process States

Running
R
currently using CPU
Runnable
R
queued & waiting for CPU time
Sleeping
S
defined (has PID) but not requesting CPU time
I
(idle)
not counted when calcul­ating load
D
(not yet addressed)
K
(not yet addressed)
 
Stopped
T
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
>
[aou]
Match to any one of the enclosed characters
<
c[aou]t
= "­cat­", "­cot­", & "­cut­" >
!!
"Last command run"
<
sudo !!
= rerun last command as root >
^x^y
Rerun last command but replace x with y
<
^usr^tmp
after running
ls /usr
will run
ls /tmp
>
!3
Rerun 3rd command from command history
!ls
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
1) SIGHUP
Hang Up
toss current config file in memory & reload it from the file system
9) SIGKILL
Kill it dead!
immedi­ately end process that isn't responding to "­ter­min­ate­" signal
15) SIGTERM
Terminate
shut down process
(default used by
kill
command)
18) SIGCONT
Continue
resume allowing process to get CPU time ("un­sto­p")
19) SIGSTOP
Stop
suspend process & prevent from getting CPU time