Show Menu
Cheatography

Rob's *nix Commands Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

VIM Cursor Movement

first, last char of line
^
,
$
move to column n of line
n/
move forwar­d/b­ackward to character x
fx
,
Fx
move forward to before char x
tx
next/p­revious paragraph, next/p­revious sentance
{}
,
()
word/token left, right
b
w
Move to end/be­ginning of file
G
,
gg

Vim Editing

insert left of current char/c­urrent line
i
I
insert to right of current char/c­urrent line
a
A
create new line under/­above current one and insert
o
O
delete text moved over by {motion} and enter insert mode
c
{motion}
delete text moved over by {motion} and do not enter insert mode
d
{motion]
copy the text moved over by {motion}
y
{motion}
visual selection mode
v
Linewise selection mode
V
Blockwise Selection mode
<C-­V>
Cut, copy, cut (& leave in insert mode)
d
,
y
,
c
If you want to search an entire file, you can use % to indicate that as the range:
:%s/se­arc­h/r­epl­ace/g
Vim Search and replace
 

Handy posix Commands (macos mostly)

IP Range Calculator
ipcalc 192.16­8.0.1/24
Show Enviro­nment Variables
env
show a single variable
echo $VARIABLE
add or update variable value
export VARIAB­LE=­"­val­ue"
View Checksum
shasum -a 256 file.dmg
list packages
sudo apt list --inst­alled | grep -i apache
sudo dpkg -l | grep -i apache
check linux version
lsb_re­lease -a

Vundle (Vim Plugin Manager)

Update Plugins from .vimrc
:Vundl­eUpdate

Admini­str­ation

Adding users
Adding Users
(s is shell, g is group, m creates home dir if not already created)
useradd UserName -s /bin/bash -G sudo -m

cURL Commands

Download File from a remote server
This works with a webpage too...
Download File from remote server 2