Files
linux-workspace/doc/cheatsheet.md
Martin Blazik c5ef791740 Bash doc
2020-09-28 20:03:12 +02:00

68 lines
1.5 KiB
Markdown

# List of popular commands and shortcuts
## Bash
### Previous command
```bash
!0 - command itself
!^ - first argument
!$ - last argument
!* - all arguments
!! - full command
```
### Useable commands
```bash
# step back
cd -
sudo su
```
### Bash
```bash
mv /path/readme.md{,.backup} # mv /path/readme.md /path/readme.md.backup
```
### To explore
- ag
- fzf
- fd
- [vim -plug](https://github.com/junegunn/vim-plug)
### Script errors
```bash
set -o errexit | set -e
set -o nounset | set -u
set -o pipefail
set -x # dump all commands
```
### Linux
usermod - modifu user account
### Tools
- [ShellCheck](https://github.com/koalaman/shellcheck) A shell script static analysis tool
- [direnv](https://direnv.net/) Directory specific variables
- [cheat](https://github.com/cheat/cheat)
- [enhancd](https://github.com/b4b4r07/enhancd) A next-generation cd command with an interactive filter
- [autojump](https://github.com/wting/autojump) A faster way to navigate your filesystem
- [BAT](https://github.com/sharkdp/bat) [root.cz](https://www.root.cz/clanky/nahrada-utility-cat-nastrojem-bat-a-ccat/) Supports syntax highlighting for a large number of programming and markup languages
- yq - YAML processor - jq wrapper for YAML documents
- jq - JSON processor
- tldr - basic command usage
- thefuck
- mount | column -t ; cat /etc/passwd | column -t -s :
- awk '!seen[$0]++' # remove duplicate lines
## Kubernetes
```bash
# ~/.kube/config
kubectl config get-contexts
kubectl config use-context <context>
```
## AWS
```bash
aws eks update-kubeconfig --name nas
```