Shell or cli

Table of Contents

link
Tools

1. Better

  1. ls: exa
  2. grep: ripgrep, rg
  3. find: fd
  4. man: tldr/cht.sh
  5. du: ncdu

    alias du="ncdu --color dark -rr -x --exclude .git --exclude node_modules"
    
  6. cat: bat
  7. ping: prettyping

    alias ping='prettyping --nolegend'
    
  8. curl: httpie, http

2. Tools

  1. zsh_stats: shows top 20 commands
  2. foreman|goreman|forego: Manage multiple processes
  3. git-chglog

    git-chglog --config cfg.yaml --output changelog.md 1.1.0..
    

3. Shell Tips

3.1. Run the last command with sudo

  • Refiled on [2019-06-27 Thu 09:16]
sudo !!

3.2. echo $(clippaste)

4. Startup files loading order (.bashrc, .profile, .zshrc etc)

4.1. For Bash

                
                
Interactive
login      
Interactive
non-login  
Script
      
/etc/profile        A                          
/etc/bash.bashrc                 A             
~/.bashrc                        B             
~/.bash_profile     B1                         
~/.bash_login       B2                         
~/.profile          B3                         
BASH_ENV                                   A   
                                               
                                               
~/.bash_logout       C                         

4.2. For Zsh

For zsh: [Note that zsh seems to read ~/.profile as well, if ~/.zshrc is not present.]

                
                
Interactive
login      
Interactive
non-login  
Script
      
/etc/zshenv          A           A         A   
~/.zshenv            B           B         B   
/etc/zprofile        C                         
~/.zprofile          D                         
/etc/zshrc           E           C             
~/.zshrc             F           D             
/etc/zlogin          G                         
~/.zlogin            H                         
                                               
                                               
~/.zlogout           I                         
/etc/zlogout         J                         

5. shellscript

6. Ref