/command-tips

Command tips

Primary LanguageShell

command-tips

Structures

dotfiles & script

  • .aliases: https://github.com/sebglazebrook/aliases
  • .aliases_legacy: tranditional alias
  • .functions: custom functions
  • .exports: export
  • .sources: sources
  • brew.sh: install brew artifacts
  • .justfile/justfile-java: justfile for java
  • bootstrap.sh: for bootstrap

shell

commands

xxxxx  > /dev/null 2>&1

Network

  • curl ifconfig.me : Shows machine’s external IP Address
  • get primary ip
ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'

Kubernetes

Productivity

File & directory

  • rip (Rm ImProved) https://github.com/nivekuil/rip
  • find . -size +100M : find fine bigger than 100M
  • gshred or srm: Delete File Permanently
  • Watch Logs in Real-Time
watch tail /var/log/auth.log
alias preview="fzf --height 40% --preview 'if file -i {}|grep -q binary; then file -b {}; else bat --color \"always\" --line-range :40 {}; fi'"

Services

  • Echo Service:
socat -v tcp-l:1234,fork exec:'/bin/cat'
  • simple web server for the current directory
Python -m SimpleHTTPServer
npx live-server

system

tools

Code

Rust

oh-my-zsh

alias -s rb=vim #opens ruby files in vim

database

  • litecli: CLI for SQLite Databases with auto-completion and syntax highlighting
  • rsql: command line interface for databases
  • sq: command line tool that provides jq-style access to structured data sources
  • DuckDB: a fast olap embedded database

CLI frameworks

  • Go: Cobra, cli
  • Node: oclif, Commander.js clap.js
  • Deno: yargs , cmd
  • Python: Click, Typer
  • Ruby: TTY, commander, GLI
  • PHP: console
  • Java: Picocli, JCommander, Clikt
  • Rust: clap-rs, pico-args, paw
  • C++: gflags, cli, docopt.cpp

Funny

Books

Shell

references