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

1.5 KiB

List of popular commands and shortcuts

Bash

Previous command

!0 - command itself
!^ - first argument
!$ - last argument
!* - all arguments
!! - full command

Useable commands

# step back
cd -
sudo su

Bash

mv /path/readme.md{,.backup} # mv /path/readme.md /path/readme.md.backup

To explore

Script errors

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 A shell script static analysis tool
  • direnv Directory specific variables
  • cheat
  • enhancd A next-generation cd command with an interactive filter
  • autojump A faster way to navigate your filesystem
  • BAT root.cz 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

# ~/.kube/config
kubectl config get-contexts
kubectl config use-context <context>

AWS

aws eks update-kubeconfig --name nas