grep [OPTION]... PATTERN [FILE]...
-i |
case insensitive |
-n |
line numbers |
-r |
recursive |
-L |
only list files that don't match |
* can put multiple file names
* PATTERN is a basic regex by default
* egrep for extended regex
PyTyle3
Ctrl-Alt-v |
tile |
Ctrl-Alt-BkSp |
untile |
Ctrl-Alt-s |
⇩ master window space |
Ctrl-Alt-r |
⇧ master window space |
Ctrl-Alt-g |
close master |
Ctrl-Alt-d |
add new master |
Ctrl-Alt-c |
rotate windows clockwise |
Ctrl-Alt-f |
float |
Ctrl-Alt-q |
quit |
terminator
Ctrl+Shift+O |
Split horizontally |
Ctrl+Shift+F |
Split vertically |
Ctrl+Shift+F |
search |
(Shift+)Win+R |
rotate windows (counter)clockwise |
Alt+(arrow) |
Move terminal focus ... |
|
|
find [-HLP] [path...] [expression]
-P |
never follow symlinks |
-L |
follow symlinks |
[expression] |
* options |
-maxdepth # |
|
-mindepth # |
* tests |
(+n,-n,n) |
|
-atime n |
n*24h |
|
-amin n |
|
-executable |
|
-group name |
or ID |
|
-size n[cwbkMG] |
|
-type [bcdpfls] |
|
-user name |
or ID |
|
-writable |
* actions |
-delete |
|
-exec cmd |
* path can be specific or .
Referencing previous commands
$? |
exit status of last command |
$0 |
$# |
# args passed to current script/ function |
$* |
list of args passed, as a space-separated string |
$@ |
list of args passed, as a delimited list |
$_ |
most recent arg |
$! |
PID of last bg command |
$$ |
pid of current shell |
$- |
option flags used |
$n |
reference to arg n in last command |
Bash History: "Event Designators"
!n |
Repeat nth command |
!-n |
Repeat command n lines back |
!! |
Last command; synonymous w/ !-1 |
!string |
Most recent command starting with string |
!?string? |
Most recent command containing string |
^str1^str2^ |
repeat last command, replacing str1 w/ str2 |
!!:s/str1/str2 |
synonymous with the above |
!$ |
last arg of last cmd; synonymous w/ !!:$ |
History "Word Designators"
$ |
last argument |
0 (zero) |
0th argument, usually the cmd word |
n |
the nth word (n-1 arg) |
^ |
1st argument (word 1) |
% |
word matched by most recent ?str? search |
* |
all words except the 0th (i.e., all args) |
Word designator is separated from event by a colon ':' unless it is ^,$,*,-,%.
For example, !!:$ becomes !$.
Words are counted from 0, so the command itself is 0.
Words can be used with events. For example, !foo:3 finds the last command starting with foo, then takes the 3rd word (2nd argument).
History: Modifiers
[g]s/str1/str2 |
& |
repeat prev substitution |
p |
prints resulting command but doesn't execute it |
e |
removes all but trailing suffix (e.g., .txt) |
r |
removes trailing suffix, keeps basename |
h |
removes "trailing" last dir in pathname, keeping "head" (path to that directory's directory) |
t |
removes all dirs in path except the last one ("tail") |
Used after the event and word designators.
Gets very complex.
I'm only showing the sed-like ones here.
|
|
pacman
-S pkg |
install |
-Su |
upgrade all out-of-date pkgs (prompts for confirmation 1st) |
-Sy |
refresh pkg list |
-Ql pkg |
list all files owned by pkg |
-Qs <regex> |
search for package (local) |
-Ss <regex> |
search repo |
-Qi pkg |
pkg info (local) |
-Si pkg |
pkg info (repo) |
-R pkg |
remove pkg |
-Rn pkg |
don't back up configs |
-Qm |
list all pkgs not found in DB (manually installed) |
-T |
check all dependencies |
-Qc pkg |
view changelog |
-Qd |
packages installed as dependencies |
-Qtd |
orphan packages |
-Qu |
view all out-of-date pkgs |
-Sii pkg |
info re: pkg & what other pkgs depend on it |
-Sl [repo] |
list all pkgs in specified repo |
-Suu |
downgrade pkgs to version in repo (i.e., if installed from testing repo, downgrade to stable) |
-Sw pkg |
download but don't install |
-Syy |
force refresh |
-Syu |
update + upgrade |
-Syu pkg |
update + upgrade all, then install pkg if still not there |
-U /path/ |
install from local file (will get dependencies from repo) |
|