bash <(curl -s https://raw.githubusercontent.com/dud380/bashconfig/master/install.sh)
command | description | syntax |
---|---|---|
tmux | split window | ctrl-b " or % |
tmux | change window | ctrl-b <h/j/k/l> |
tmux | resize window | ctrl-b <H/J/K/L> |
sed | uncomment lines in file | sed '/pubkeyauthentication/i s/^#//' /etc/ssh/sshd_config |
sed | uncomment lines, save changes, and save copy of old file as .old | sed -i.old '/pubkeyauthentication/i s/^#//' /etc/ssh/sshd_config |
awk | get all uncommented lines | awk '!/^# |
awk | get all users | awk -F":" '$3 > 999 {print $1}' /etc/passwd |
awk | filter dmesg by column string | dmesg |
vim | search replace | :%s/foo/bar/gc |
vim | yank to register r | "ry |
vim | paste from register r | "rp |
vim | show registers | :reg or :reg r |
vim | show registers | :reg or :reg r |
bash | command for specific column in file | awk '{print $2}' filename |
grep |
|
|
git | add all changed | git add -u . |
find | find and cat all csv files & pipe to vim | find ./ -name '*.csv' -exec cat {} ; |
find | find and unzip zip files | find ./ -name '*.zip' -execdir unzip -r {} ; |
find | find and unrar rar files | find ./ -name '*.rar' -execdir unrar e -o+ {} ; |
find | find and move epub files | find ./ -name '*.epub' -execdir mv {} ~/Books ; |
nmap | scan all ports | nmap -p- |
tar | pack | tar -cvf apa.tar ./apa ; tar cvfz apa.tar.gz ./apa ; tar cvfj apa.tar.tb2 ./apa |
tar | unpack | tar -xvf apa.tar ; tar xvfz apa.tar.gz ; tar xvfj apa.tar.tb2 |