Intro

Scripts, CLI automation, and custom tools for Linux, WSL2, and other environments

Prepare environment

Create Scripts Directory

  • Create ~/bin directory for user-specific scripts 1 and cd into it
mkdir -p ~/bin && cd ~/bin
  • Add ~/bin to PATH (so scripts can be run from anywhere)
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
  • Reload shell
source ~/.bashrc

Making Scripts Executable

  • Make the script executable
chmod +x example_script.sh
  • Run the script
example_script.sh

Bash Scripts

Git, GitHub, and SSH Configuration

Auto-repo creation

  • Install GitHub CLI
sudo apt install gh
gh --version
  • Authenticate
gh auth login
  • Create init-repo.sh script in ~/bin
  • Usage: Create a public repo
./init-repo.sh my-project
  • Create a private repo
./init-repo.sh my-project private

Footnotes

  1. https://www.reddit.com/r/bash/comments/hemkuv/where_do_you_store_your_bash_scripts/

0 items under this folder.